Socket
Socket
Sign inDemoInstall

json-to-pretty-yaml

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    json-to-pretty-yaml

A node module to convert JSON to YAML


Version published
Weekly downloads
2.4M
decreased by-1.42%
Maintainers
1
Install size
38.0 kB
Created
Weekly downloads
 

Readme

Source

♻️ 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

Keywords

FAQs

Last updated on 30 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc