Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

JSON/Object to YAML? #40

Open
ghost opened this issue Dec 11, 2011 · 1 comment
Open

JSON/Object to YAML? #40

ghost opened this issue Dec 11, 2011 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 11, 2011

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

@coolaj86
Copy link

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);
}());

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant