json-compressor
Removes whitespace and JavaScript-style comments from a JSON string.
Last updated 9 years ago by kitcambridge .
Repository · Original npm · Tarball · package.json
$ cnpm install json-compressor 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.0.1                                ...           latest (9 years ago)

1 Versions

  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |