Package Exports
- to-through
- to-through/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (to-through) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
to-through
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