strstr is a small Node.js library that provides a way of both reading a string as a Node
stream and to gather all data from a Node stream and return a string from it.
var ss = ;// Read a string as if it were a Node streamss;// Write some stream to a stringvar stream = ;ss
Returns a readable stream that will emit the given
string as regular
The number of
data events fired depends on both the
string and the
options given to the
function, and should generally not be relied upon. In particular, no
data events are ever fired
if the passed string is empty.
options object can contain the following keys:
chunkSize: Determines the size of the chunks emitted by the stream. If unspecified or set to 0, selects a default size that's small but not too small.
Returns a Promise that will eventually be fulfilled with the accumulated value read from the
stream]. If the passed stream emits an
error event, the returned promise
will be rejected instead, with the emitted error as it rejection reason.