stream-toduplex
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

stream-toduplex

Make one writable stream and one readable stream into a single duplex stream.

Install

npm install --save stream-toduplex

Usage

const toDuplex = require("stream-toduplex");

// Assume that there are some TransformStreams.
const first = someTransformStream();
const middle = someTransformStream();
const last = someTransformStream();

// Make the above transforming processes into one duplex stream
const duplex = toDuplex(first, last);
first.pipe(middle).pipe(last);

You can also use toDuplex.connect in the above situation.

const duplex = toDuplex.connect([first, middle, last]);
// first.pipe(middle).pipe(last);  // not needed

Readme

Keywords

Package Sidebar

Install

npm i stream-toduplex

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.87 kB

Total Files

5

Last publish

Collaborators

  • motsumaro