json-compressor

0.0.1 • Public • Published

json-compressor

json-compressor is a simple Node module that removes whitespace and JavaScript-style comments from a JSON string.

$ npm install json-compressor

Example

var fs = require("fs"), compress = require("../"), source = fs.readFileSync("example.json", "utf8");
console.log(JSON.parse(compress(source)));
=> { "name": "Kit", "age": 19, "hobbies": ["programming", "running"], "source": "123\\n// Line comment.\\n/* Block comment. */\\n456" }

License

Public domain.

/json-compressor/

    Package Sidebar

    Install

    npm i json-compressor

    Weekly Downloads

    3

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • kitcambridge