node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



stream decodes base64 and quoted printable data


npm install ee-stream-decoder


var StreamDecoder 	= require( "./" );

var   decoder 	= new StreamDecoder( "base64" )
	, result 	= "";

decoder.on( "data", function( buf ){
	result += buf.toString();
} );

decoder.on( "end", function(){
	log( result );
	// A "transform" stream is a duplex stream where the output is causally 
	// connected in some way to the input, such as a zlib stream or a crypto stream.
} );

decoder.write( "Q" );
decoder.write( "SAidHJhbnNmb3JtIiBzdHJlYW0gaXMgYSBkdXBsZXggc3RyZWFtI" );
decoder.write( "\n" );
decoder.write( "HdoZXJlIHRoZSBvd\n\rXRwdXQgaXMgY2F1c2FsbHkgY29ubmVjdGVkIGluIHNvbWUgd2" );

decoder.end( "F5IHRvIHRoZSBpbnB1dCwgc3VjaCBhcyBhIHpsaWIgc3RyZWFtIG9yIGEgY3J5cHRvIHN0cmVhbS4=" );