1.8 KiB
1.8 KiB
Resume Generator with docx-js
Overview
This project generates professional Word documents (.docx) from JSON Resume format using the docx npm package.
Setup
npm install docx
Usage
- Place your resume data in
resume.jsonfollowing the JSON Resume schema (https://jsonresume.org/schema/) - Run:
node generate_resume.js - Output:
Phillip_Tarrant_Resume_{YEAR}.docx
Key docx-js Patterns
Page Setup
- Always set explicit page size (US Letter: 12240 x 15840 DXA, where 1440 DXA = 1 inch)
- Set margins in DXA units
Text Formatting
- Use
TextRunfor text with formatting (bold, italic, size, font) - Size is in half-points (22 = 11pt, 24 = 12pt, 32 = 16pt)
- Always specify font explicitly for consistency
Lists/Bullets
- Never use unicode bullets manually (like "•" in text)
- Use
numberingconfig withLevelFormat.BULLET - Reference the numbering config in paragraphs
Critical Rules
- Never use
\nfor line breaks - use separate Paragraph elements - Always set table
widthwhen using tables - PageBreak must be inside a Paragraph
- Use Arial as default font (universally supported)
Customization
- Modify margins in
sections[0].properties.page.margin - Change fonts by updating the
fontproperty in TextRun objects - Adjust spacing with
spacing: { before: X, after: Y }on Paragraphs
JSON Resume Schema
The input JSON should follow the standard JSON Resume format with these sections:
basics: name, label, email, phone, url, summary, location, profileswork: array of positions with name, position, startDate, endDate, summary, highlightseducation: institution, area, studyType, startDate, endDate, scorecertificates: name, issuer, dateawards: title, awarder, date, summaryskills: array of skill categories with name, level, keywords