seal-stream-as-string

0.0.5 • Public • Published

seal-stream-as-string

CircleCI AppVeyor

seal-stream-as-string transforms streams to strings.

Installation

$ npm install seal-stream-as-string

Quick start

First you need to add a reference to seal-stream-as-string within your application.

const StreamAsString = require('seal-stream-as-string');

Then use the write function to add data to the stream. Once you are done, call end. Afterwards, you may use the asString function to get the stringified stream.

const streamAsString = new StreamAsString();
 
streamAsString.write('foo');
streamAsString.write('bar');
streamAsString.end();
 
console.log(streamAsString.asString()); // => 'foobar'

Alternatively, you may listen to the as-string event. It is raised after the stream has been ended.

const streamAsString = new StreamAsString();
 
streamAsString.once('as-string', (asString) => {
  console.log(asString); // => 'foobar'
});
 
streamAsString.write('foo');
streamAsString.write('bar');
streamAsString.end();

Running the build

To build this module use roboter.

$ bot

Readme

Keywords

none

Package Sidebar

Install

npm i seal-stream-as-string

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • manni19682