var yaml = require('yaml');
var fs = require('fs');
fs.readFile('../config/development.yaml', function read(err, data) {
if (err) throw err;
console.log(data); // Put all of the code here (not the best solution)
console.log(yaml.eval(data));
});
output:
has no method 'replace'
at Object.exports.tokenize (/Users/me/node_modules/yaml/lib/yaml.js:75:19)
at Object.exports.eval (/Users/me/node_modules/yaml/lib/yaml.js:384:30)
yaml file:
environment: development logLevel: 5 foobar: wtf
js test:
var yaml = require('yaml'); var fs = require('fs');
fs.readFile('../config/development.yaml', function read(err, data) { if (err) throw err; console.log(data); // Put all of the code here (not the best solution) console.log(yaml.eval(data)); });
output:
has no method 'replace' at Object.exports.tokenize (/Users/me/node_modules/yaml/lib/yaml.js:75:19) at Object.exports.eval (/Users/me/node_modules/yaml/lib/yaml.js:384:30)