udondan:yml

A YAML 1.2 parser and serializer. Converts YAML files to JSON and JS objects to YAML.


License
MIT
Install
meteor add udondan:yml@=3.2.2_1

Documentation

yml

NO LONGER MAINTAINED

A YAML 1.2 parser and serializer for Meteor. Converts YAML files to JSON and JS objects to YAML.

This package packs js-yaml 3.2.2 for Meteor. See the online demo for the capabilities of this packages, including anchors, references and hash merging.

##Installation

meteor add udondan:yml

##Quick examples

###Convert YAML file to JSON

var fs = Npm.require('fs');

try {
  var data = YAML.safeLoad(fs.readFileSync('/path/to/file.yml', 'utf8'));
  console.log(data);
} catch (e) {
  console.log(e);
}

###Convert JS object to YAML

var data = {
  "some": "data"
}

var yml = YAML.safeDump(data);
console.log(yml);

Full API documentation on the github page of js-yaml.

##License: MIT