str-stream
v0.1.2
Published
JSON.stringify stream for json pretty print
Downloads
515
Readme
StringifyStream
JSON.stringify and prettify for Stream
Usage
$ npm install stringify-stream -S
var fs = require("fs");
var StringifyStream = require('stringify-stream');
var ss = new StringifyStream({
spaces: 2,
});
// { "hello": "world", "deep": "purple" }
var inStream = fs.createReadStream("test/in.json");
var outStream = fs.createWriteStream("test/out.json");
// prettifized!!
// {
// "hello": "world",
// "deep": "purple"
// }
inStream.pipe(ss).pipe(outStream);