Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parser-yaml

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parser-yaml

parser-cache compatible YAML parser, using js-yaml.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
55
decreased by-57.36%
Maintainers
1
Weekly downloads
 
Created
Source

parser-yaml NPM version

parser-cache compatible YAML parser, using js-yaml.

Install

Install with npm

npm i parser-yaml --save

Run tests

npm test

Usage

var parser = require('parser-yaml');

parse

parser.parse(str, options, function(err, res) {
  if (err) { throw err; }
  console.log(res);
});

parseFile

parser.parseFile('fixtures/a.yml', function (err, res) {
  if (err) { throw err; }
  console.log(res);
});

parseSync

var res = parser.parseSync(str, options);
console.log(res);

API

parse

  • 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).

parseSync

  • str {String|Object}: The object or string to parse.
  • returns: {Object}

Parse the given str of YAML.

parseFile

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}
parser.parseFile('foo/bar/baz.yml');

parseFileSync

YAML file support. Parse a file at the given filepath.

  • filepath {String}
  • options {Object}: Options to pass to [js-yaml]
parser.parseFile('foo/bar/baz.yml');

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on November 24, 2014.

Keywords

FAQs

Package last updated on 24 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc