包详细信息

to-through

gulpjs8.6mMIT3.0.0

Wrap a Readable stream in a Transform stream.

transform, readable, through, wrap

自述文件

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

更新日志

Changelog

3.0.0 (2022-09-07)

⚠ BREAKING CHANGES

  • Switch to streamx (#9)
  • Upgrade scaffold, dropping node <10 support (#8)

Features

Miscellaneous Chores

  • Upgrade scaffold, dropping node <10 support (#8) (f095480)