js-yaml-front.js 471 B

123456789101112131415161718
  1. #!/usr/bin/env node
  2. var program= require('commander')
  3. , jsYaml = require('../lib/js-yaml-front');
  4. program
  5. .version('1.0.1')
  6. .usage('[options] <file>')
  7. .option('-c, --content [name]', 'set the property name for the files contents [__content]')
  8. .parse(process.argv);
  9. if(program.args.length > 0) {
  10. if(program.content) {
  11. console.log(jsYaml.loadFront(program.args[0], program.content));
  12. } else {
  13. console.log(jsYaml.loadFront(program.args[0]));
  14. }
  15. }