streamify-string
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/streamify-string package

1.0.1 • Public • Published

Build Status npm npm

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        = require('streamify-string');
const myWritableStream = require('../path/to/file.js');
 
// initialize a string
var str = 'Grumpy wizards make toxic brew for the evil Queen and Jack.'
 
// "Streamify" that string and pipe it to a writeable stream
Streamify(str).pipe(myWriteableStream);

Parameters

const streamified = Streamify(str, [options]);
  • str: the string that the stream should output.
  • options: Optional options to pass to the stream constructor. (Documentation)

Events

The stream will emit the following events:

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    3,026
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    3,026
  • 1.0.0
    25

Package Sidebar

Install

npm i streamify-string

Weekly Downloads

3,051

Version

1.0.1

License

MIT

Last publish

Collaborators

  • chrisallenlane