0.1.2 • Published 8 years ago

@appscode/json2yaml v0.1.2

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

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

Acknowledgement

For string conversion, we're using yaml.js's Escaper and Pattern.