tj/js-yaml

JSON/Object to YAML?

Opened this issue · 1 comments

Is it possible to convert a JSON or Javascript object into YAML?

I just wrote a stringifier and a cli for both the parser and the stringifier.

npm install -g json2yaml yaml2json

Example:

(function () {
  "use strict";

  var YAML = require('json2yaml')
    , ymlText
    ;

  ymlText = YAML.stringify({
      "foo": "bar"
    , "baz": "corge"
  });

  console.log(ymlText);
}());