ee-stream-buffer

creates a readable stream from a buffer

ee-stream-buffer

creates a readable stream from a buffer

npm install ee-stream-buffer
var   StreamBuffer      = require( "./" )
    , StreamCollector   = require( "ee-stream-collector" );


var   buf               = new Buffer( 20 )
    , streamBuffer      = new StreamBuffer( buf )
    , collector         = new StreamCollector();


collector.on( "end", function( data ){
    console.log( data );    // new buffer with same contents as the original buffer
    console.log( buf );     // original buffer
} );

streamBuffer.pipe( collector );