Created
June 27, 2015 14:39
-
-
Save clonn/844d2efd1149fb1d1098 to your computer and use it in GitHub Desktop.
buffer2Stream
This file contains hidden or 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 stream = require('stream'); | |
// Initiate the source | |
var bufferStream = new stream.PassThrough(); | |
// Write your buffer | |
bufferStream.end(new Buffer('Test data.')); | |
// Pipe it to something else (i.e. stdout) | |
bufferStream.pipe(process.stdout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment