sjf

simple-json-formatter

A JSON formatter

Showing:

Popularity

Downloads/wk

15

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Format JSON string with indent.

Typescript Example

let JSONFormatter = require("simple-json-formatter");

let a = {
    b: 42,
    c: "d",
    e: [
        "f",
        "g"
    ],
    h: {
        i: "j",
        k: null
    }
}

let json = JSON.stringify(a);
console.log(json);
let formattedJson = JSONFormatter.format(json, "\t");
console.log(formattedJson);

Output:

{"b":42,"c":"d","e":["f","g"],"h":{"i":"j","k":null}}
{
        "b": 42,
        "c": "d",
        "e": [
                "f",
                "g"
        ],
        "h": {
                "i": "j",
                "k": null
        }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100