Skip to content
gulpjsPublic

About

Sink your streams.

Topics

Resources

Security policy

Stars

17 stars

Watchers

4 watching

Forks

Repository files navigation

lead

NPM version Downloads Build Status Coveralls Status

Sink your streams.

Usage

var { Readable, Transform } = require("streamx");
var sink = require("lead");

// Might be used as a Transform or Writeable
var maybeThrough = new Transform({
  transform(chunk, cb) {
    // processing
    cb(null, chunk);
  },
});

Readable.from(["hello", "world"])
  // Sink it to behave like a Writeable
  .pipe(sink(maybeThrough));

API

sink(stream)

Takes a stream to sink and returns the same stream. Sets up event listeners to infer if the stream is being used as a Transform or Writeable stream and sinks it on nextTick if necessary. If the stream is being used as a Transform stream but becomes unpiped, it will be sunk. Respects pipe, on('data') and on('readable') handlers.

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

Sink your streams.

Topics

Resources

Security policy

Stars

17 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages