parser-cache compatible YAML parser, using js-yaml.
npm install parser-yaml> parser-cache compatible YAML parser, using js-yaml.
``bash`
npm i parser-yaml --save
`bash`
npm test
js
var parser = require('parser-yaml');
`$3
`js
parser.parse(str, options, function(err, res) {
if (err) { throw err; }
console.log(res);
});
`$3
`js
parser.parseFile('fixtures/a.yml', function (err, res) {
if (err) { throw err; }
console.log(res);
});
`$3
`js
var res = parser.parseSync(str, options);
console.log(res);
`API
$3
*
str {String|Object}: The object or string to parse.
* options {Object|Function}: or cb callback function.
* cb {Function}: callback function. Parse the given
str of YAML and callback cb(err, obj).$3
*
str {String|Object}: The object or string to parse.
* returns: {Object} Parse the given
str of YAML.$3
YAML file support. Parse a file at the given
filepath and callback callback(err, obj).*
filepath {String}
* options {Object|Function}: or callback function.
* callback {Function} `js
parser.parseFile('foo/bar/baz.yml');
`$3
YAML file support. Parse a file at the given
filepath.*
filepath {String}
* options {Object}: Options to pass to [js-yaml] `js
parser.parseFile('foo/bar/baz.yml');
``Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
+ github/jonschlinkert
+ twitter/jonschlinkert
*
_This file was generated by verb on November 24, 2014._
[parser-cache]: https://github.com/jonschlinkert/parser-cache