How to use resume-schema - 8 common examples

To help you get started, we’ve selected a few resume-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mblarsen / resume-linkedin / index.js View on Github external
linkedIn.people.me(function(err, $in) {
      req.session.$in = $in;
      resume = makeResume($in);
      resumeSchema.validate(resume, function (result, validationErr) {
        var exitCode = 0;
        if (validationErr || result.valid !== true) {
          console.error(validationErr);
          console.error(result);
          exitCode = 1;
        } else {
          var resumeString = JSON.stringify(resume, undefined, 2);
          log('saving file resume.json:' + resumeString.length);
          fs.writeFileSync(__dirname + '/resume.json', resumeString);
          console.log('Done!');
        }
        res.render('index', { accessToken: req.session.accessToken, resume: resume, result: result });
        process.exit(exitCode);
      });
    });
  } else {
github jsonresume / resume-cli / validate.js View on Github external
function validate(resumeData, callback) {
    resumeSchema.validate(resumeData, function(report, errs) {
        if (errs) {
            console.log('TEST FAILED'.red);
            errorFormatter(errs);
            process.exit();
        } else {
            console.log('TEST SUCCESSFUL'.green);
            console.log('Number of errors:'.cyan, report.errors.length);
            console.log('To publish your resume at'.cyan, 'http://jsonresume.org', 'simply type the command'.cyan, 'node index publish (resume publish)');
            process.exit();
        }
    });
}
module.exports = {
github jsonresume / resume-cli / publish.js View on Github external
function publish(resumeData, force) {
    resumeSchema.validate(resumeData, function(report, errs) {
        if (errs && !force) {
            console.log('Error: Resume failed to publish.'.red);
            console.log('Reasons:');
            console.log(validate.errorFormatter(errs));
            console.log('For error troubleshooting type:'.cyan, 'node index test');
            console.log('Or to try publish regardless of the error warning, type:'.cyan, 'node publish --force');
            process.exit();
        } else {
            if (force) {
                console.log('You resume.json did not pass formatting tests. Attempting to publish anyway...'.yellow);
            }
            console.log('publishing...');
            publishSend(resumeData);
        }
    });
}
github jsonresume / resume-cli / lib / init.js View on Github external
}, function(er, email) {
            if (er) {
                console.log();
                process.exit();
            }

            resumeJson.basics.name = name;
            resumeJson.basics.email = email;

            fs.writeFileSync(process.cwd() + '/resume.json', JSON.stringify(resumeJson, undefined, 2));

            console.log('\nYour resume.json has been created!'.green);
            console.log('');
            console.log('To generate a formatted .html .md .txt or .pdf resume from your resume.json');
            console.log('type: `resume export [someFileName]` including file extension eg: `resume export myresume.html`');
            console.log('\nYou can optionally specify an available theme for html and pdf resumes using the --theme flag.');
            console.log('Example: `resume export myresume.pdf --theme flat`');
            console.log('Or simply type: `resume export` and follow the prompts.');
            console.log('');

            process.exit();
            callback(true);
        });
github jsonresume / resume-cli / lib / init.js View on Github external
}, function(er, email) {
            if (er) {
                console.log();
                process.exit();
            }

            resumeJson.basics.name = name;
            resumeJson.basics.email = email;

            fs.writeFileSync(process.cwd() + '/resume.json', JSON.stringify(resumeJson, undefined, 2));

            console.log('\nYour resume.json has been created!'.green);
            console.log('');
            console.log('To generate a formatted .html .md .txt or .pdf resume from your resume.json');
            console.log('type: `resume export [someFileName]` including file extension eg: `resume export myresume.html`');
            console.log('\nYou can optionally specify an available theme for html and pdf resumes using the --theme flag.');
            console.log('Example: `resume export myresume.pdf --theme flat`');
            console.log('Or simply type: `resume export` and follow the prompts.');
            console.log('');

            process.exit();
            callback(true);
        });
    });
github jsonresume / resume-cli / lib / init.js View on Github external
}, function(er, email) {
            if (er) {
                console.log();
                process.exit();
            }

            resumeJson.basics.name = name;
            resumeJson.basics.email = email;

            fs.writeFileSync(process.cwd() + '/resume.json', JSON.stringify(resumeJson, undefined, 2));

            console.log('\nYour resume.json has been created!'.green);
            console.log('');
            console.log('To generate a formatted .html .md .txt or .pdf resume from your resume.json');
            console.log('type: `resume export [someFileName]` including file extension eg: `resume export myresume.html`');
            console.log('\nYou can optionally specify an available theme for html and pdf resumes using the --theme flag.');
            console.log('Example: `resume export myresume.pdf --theme flat`');
            console.log('Or simply type: `resume export` and follow the prompts.');
            console.log('');

            process.exit();
            callback(true);
        });
    });
github jsonresume / theme-manager / lib / theme.js View on Github external
fs.readFileAsync(path.join(root, themeDirectory, 'package.json'), 'utf8').then(function (themePackageJson) {
        var output = '';
        output += 'Theme returned an error.';
        output += '<pre>';
        output += error.stack;
        output += '</pre>';
        output += '<h3>Theme Info</h3>';
        output += '<pre>';
        output += themePackageJson;
        output += '</pre>';
        output += '<p><strong>We just launched the official 0.0.0 version recently, please make sure you update before continuing.</strong></p>';
        output += '<h3>Resume.json Validation Test</h3>';
        delete options.resume._id;
        delete options.resume.jsonresume;
        delete options.resume.profiles;
        schema.validate(options.resume, function(blah, err) {
          output += '<pre>';
          output += JSON.stringify(err, undefined, 4);
          output += '</pre>';
          res.send(output)
        })
      });
    })

resume-schema

JSON Resume Schema

MIT
Latest version published 4 months ago

Package Health Score

73 / 100
Full package analysis

Similar packages