cleanjson
v0.1.2
Published
Format JSON document from stdin as 'comma-first' JSON
Downloads
4
Readme
Installation
$ npm install -g cleanjson
CLI Usage
Publish your "dirty" JSON at some URL using services such as http://hastebin.com, http://gist.github.com or http://cl.ly
Acquire a URL that points to "raw" JSON, such as: http://goo.gl/7IiVZ
Run a command such as:
$ curl -Ls http://goo.gl/7IiVZ | cleanjson
Enjoy
Using as a Module
var cj = require('cleanjson');
var input = '{"a": 13123, "b": "13123", "ccc": 112}';
cj.clean(input, function(err, cleanJSON) {
console.log(cleanJSON);
process.exit(0);
});
will produce following output:
{
"a": 13123
, "b": "13123"
, "ccc": 112
}