json-pretty

0.0.1 • Public • Published

Simple module for producing nice JSON.

Similar to the https://www.npmjs.com/package/json-prettify CLI tool, except you can require this one in your projects.

It also alphabetizes keys, which is useful for producing meaningful diffs.

If there are JSON files in your project, it makes sense to normalize them with this module, to make version control easier.

Usage

> var jsonStringify = require('json-pretty');
undefined
> jsonStringify({a: 'b'})
'{\n  "a": "b"\n}'
> 

/json-pretty/

    Package Sidebar

    Install

    npm i json-pretty

    Weekly Downloads

    411

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • michielbdejong