Socket
Socket
Sign inDemoInstall

lead

Package Overview
Dependencies
9
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lead

Sink your streams.


Version published
Maintainers
1
Install size
191 kB
Created

Readme

Source

lead

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Sink your streams.

Usage

var from = require('from2');
var through = require('through2');
var sink = require('lead');

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

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

Keywords

FAQs

Last updated on 28 Apr 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc