json-to-pretty-yaml2
v1.0.0
Published
A node module to convert JSON to YAML require → import migrate
Downloads
2
Readme
♻️ json-to-pretty-yaml2
A node module to convert JSON to pretty YAML Fork by json-to-pretty-yaml require → import migrate
Installation
npm install --save json-to-pretty-yaml2
Usage
index.js
import { stringify } from "json-to-pretty-yaml2";
const data = 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"