Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Accepts a string and returns a readable stream that outputs the string.

License

Notifications You must be signed in to change notification settings

chrisallenlane/streamify-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Accepts a string and returns a readable stream that outputs the string.

Resources

License

Stars

Watchers

Forks

Packages

No packages published