run.js 360 B

123456789101112131415
  1. var path = process.argv[2],
  2. fs = require('fs'),
  3. yaml = require('../lib/yaml')
  4. if (!path)
  5. throw new Error('provide path to yaml file')
  6. fs.readFile(path, function(err, fileContents) {
  7. fileContents = fileContents.toString()
  8. console.log('\n')
  9. console.log(fileContents)
  10. console.log('\noutputs:\n')
  11. console.log(yaml.eval(fileContents))
  12. })