Javascript JSON to YAML converter
Switch branches/tags
Nothing to show
Clone or download
jeffsu Merge pull request #4 from levindoneto/master
Add square brackets in case of empty object
Latest commit 86fe4f2 Jan 1, 2018
Permalink
Failed to load latest commit information.
src Add square brackets in case of empty object Dec 29, 2017
test support for unicode chars and more test cases. Nov 5, 2012
LICENSE adding license Apr 27, 2012
README.md updating docs Aug 19, 2011

README.md

json2yaml

Converts json or simple javascript objects into a yaml format.

Installation

Include json2yaml.js (in src directory) via script tag and then run:

var obj  = { hello: 'world', hello2: [ 'hello', 'world' ] };
var yaml = json2yaml(obj);
console.log(yaml);

This outputs

hello: world
hello2:
  - hello
  - world