@jackgreen2018/resume-pdf-engine
v1.0.3
Published
A lightweight, high-performance Resume/CV PDF generator for Node.js and the browser. Professional templates, zero dependencies at runtime.
Maintainers
Readme
@jackgreen2018/resume-pdf-engine
A lightweight, high-performance Resume/CV PDF generator for Node.js and the browser. Professional templates, zero dependencies at runtime.
Installation
npm install @jackgreen2018/resume-pdf-engineUsage
Node.js
import { generateResume } from '@jackgreen2018/resume-pdf-engine';
import { writeFile } from 'fs/promises';
const resumeData = {
name: 'Jane Mitchell',
email: '[email protected]',
phone: '+1 (555) 123-4567',
summary: 'Senior software engineer with 8+ years of experience...',
experience: [
{
role: 'Senior Software Engineer',
company: 'TechCorp Inc.',
startDate: '2020-03',
endDate: '2024-06',
bullets: ['Led a team of 6 engineers', 'Reduced latency by 40%']
}
],
education: [
{ degree: 'M.S. Computer Science', school: 'Stanford University', year: '2017' }
],
skills: ['JavaScript', 'TypeScript', 'React', 'Node.js', 'AWS']
};
const pdfBuffer = await generateResume(resumeData, 'modern');
await writeFile('resume.pdf', pdfBuffer);
console.log(`Generated ${pdfBuffer.length} byte PDF`);Browser
import { generateResume } from '@jackgreen2018/resume-pdf-engine';
const data = { name: 'John Doe', summary: 'Experienced developer...' };
const pdfBytes = await generateResume(data);
const blob = new Blob([pdfBytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
// Trigger download...API
generateResume(data, template)
Parameters:
data(object): Resume data following the ResumeData interfacetemplate(string):'modern'or'classic'(defaults to'modern')
Returns: Promise<Uint8Array> — A valid PDF document
ResumeData Interface:
interface ResumeData {
name: string;
email?: string;
phone?: string;
location?: string;
summary?: string;
experience?: ExperienceEntry[];
education?: EducationEntry[];
skills?: string[];
certifications?: string[];
languages?: string[];
}
interface ExperienceEntry {
role: string;
company: string;
startDate: string;
endDate?: string;
current?: boolean;
bullets?: string[];
}
interface EducationEntry {
degree: string;
school: string;
year?: string;
}Benchmark
Benchmark against a manual pdf-lib implementation (10 iterations, single-core):
| Metric | Library (ms) | Manual (ms) | Speedup | |--------|-------------|-------------|---------| | Resume Generation | 8.49 | 8.49 | 1.00x | | Output Size | 4050 bytes | — | — | | Page Count | 3 | — | — |
Run with: npm run benchmark
License
MIT
