-
-
Save dlmanning/255e10133dbe4c844e38 to your computer and use it in GitHub Desktop.
Super minimal streams2 implementation of a json -> stringified transform stream.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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