Feb 15, 2022
Below is a converter that transforms JSON into YAML.
In Node.js
To convert JSON to YAML, you should install json-to-pretty-yaml.
Use the stringify
function() from the npm module to convert the JSON.
const YAML = require('json-to-pretty-yaml');
const json = '{ "a": 1, "b": 2, "c": 3 }';
const data = YAML.stringify(json);
data;
More Stories like this
GitHub – droppyjs/droppy: Self-hosted file storage
Jest VSCode Extension | How to code Tutorial.
Import SVGs as React Components | How to code Tutorial