A node module to convert JSON to pretty YAML
npm install --save js-to-yaml
const fs = require('fs');
const YAML = require('js-to-yaml');
const json = require('input.json');
const data = YAML.stringify(json);
fs.writeFile('output.yaml', data);{
"a": 1,
"b": 2,
"c": [
{
"d": "cool",
"e": "new"
},
{
"f": "free",
"g": "soon"
}
]
}a: 1
b: 2
c:
- d: "cool"
e: "new"
- f: "free"
g: "soon"npm test