Package Exports
- json-to-pretty-yaml
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json-to-pretty-yaml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
♻️ json-to-pretty-yaml
A node module to convert JSON to pretty YAML
Installation
npm install --save json-to-pretty-yaml
Usage
index.js
const fs = require('fs');
const YAML = require('json-to-pretty-yaml');
const json = require('input.json');
const data = YAML.stringify(json);
fs.writeFile('output.yaml', data);input.json
{
"a": 1,
"b": 2,
"c": [
{
"d": "cool",
"e": "new"
},
{
"f": "free",
"g": "soon"
}
]
}output.yaml
a: 1
b: 2
c:
- d: "cool"
e: "new"
- f: "free"
g: "soon"Testing
npm test