Skip to content

About

Wrap a Readable stream in a Transform stream.

Topics

Resources

Security policy

Stars

10 stars

Watchers

3 watching

Forks

Repository files navigation

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.

Strict No LLM / No AI Policy

No LLMs for issues.

No LLMs for patches / pull requests.

No LLMs for comments on the bug tracker, including translation.

English is encouraged, but not required. You are welcome to post in your native language and rely on others to have their own translation tools of choice to interpret your words.

License

MIT

About

Wrap a Readable stream in a Transform stream.

Topics

Resources

Security policy

Stars

10 stars

Watchers

3 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages