streamify-string
streamify-string
accepts a string
and returns a Readable stream that
outputs the string. It's useful for stubbing Readable streams when writing
unit-tests for Writeable, Duplex, and Transform streams.
const Streamify = ;const myWritableStream = ; // initialize a stringvar str = 'Grumpy wizards make toxic brew for the evil Queen and Jack.' // "Streamify" that string and pipe it to a writeable stream;
Parameters
const streamified = ;
str
: thestring
that the stream should output.options
: Optional options to pass to the stream constructor. (Documentation)
Events
The stream will emit the following events: