UNPKG

resume-lite

Version:

Generate professional resumes effortlessly using resume.js. Input your information, and our tool will create polished and customizable resumes in various formats. Perfect for developers, designers, and any job seekers looking to showcase their skills and

41 lines (40 loc) 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generate = exports.AvailableTemplates = void 0; //template functions: const edge_1 = require("./templates/edge"); const stack_1 = require("./templates/stack"); // Define an enumeration or constant for available templates exports.AvailableTemplates = { STACK: 'stack', EDGE: 'edge', }; // Map template names to their respective functions const templateFunctions = { stack: stack_1.stack, edge: edge_1.edge, }; /** * Generates a resume using the specified template and resume data. * * Available template names: * * - stack * - edge * * @param {TemplateName} templateName - The name of the template to use. * @param {ResumeData} resumeData - The resume data to be used in the template. * @returns {string} The generated resume as a string. * @throws {Error} If the specified template name is not available. */ function generate(templateName, resumeData) { const templateFunction = templateFunctions[templateName]; if (!templateFunction) { throw new Error(`Template ${templateName} is not available. Available templates: ${Object.values(exports.AvailableTemplates).join(', ')}`); } return templateFunction(resumeData); } exports.generate = generate; exports.default = { generate, };