0.0.1 • Published 12 years ago

json-compressor v0.0.1

Weekly downloads
5
License
-
Repository
github
Last release
12 years ago

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.