Skip to content

Instantly share code, notes, and snippets.

@dlmanning
Created June 24, 2013 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlmanning/255e10133dbe4c844e38 to your computer and use it in GitHub Desktop.
Save dlmanning/255e10133dbe4c844e38 to your computer and use it in GitHub Desktop.
Super minimal streams2 implementation of a json -> stringified transform stream.
var Transform = require('stream').Transform;
var JSONStringify = new Transform({objectMode: true});
JSONStringify._transform = function (chunk, encoding, done) {
this.push(JSON.stringify(chunk));
done();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment