1. lead
Sink your streams.
lead
Package: lead
Created by: gulpjs
Last modified: Thu, 22 Sep 2022 20:19:19 GMT
Version: 4.0.0
License: MIT
Downloads: 7,028,641
Repository: https://github.com/gulpjs/lead

Install

npm install lead
yarn add lead

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.

License

MIT

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code