to-through
Wrap a Readable stream in a Transform stream.
Last updated 2 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install to-through 
SYNC missed versions from official npm registry.

to-through

NPM version Downloads Build Status Coveralls Status

Wrap a Readable stream in a Transform stream.

Usage

var { Readable } = require('streamx');
var concat = require('concat-stream');
var toThrough = require('to-through');

var readable = Readable.from([' ', 'hello', ' ', 'world']);

// Can be used as a Readable or Transform
var maybeTransform = toThrough(readable);

Readable.from(['hi', ' ', 'there', ','])
  .pipe(maybeTransform)
  .pipe(
    concat(function (result) {
      // result === 'hi there, hello world'
    })
  );

API

toThrough(readableStream)

Takes a Readable stream as the only argument and returns a Transform stream wrapper. Any data piped into the Transform stream is piped passed along before any data from the wrapped Readable is injected into the stream.

License

MIT

Current Tags

  • 3.0.0                                ...           latest (2 years ago)

4 Versions

  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (2)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE