# lead

> Sink your streams.

Latest version **4.0.0** (published 2022-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install lead
pnpm add lead
yarn add lead
bun add lead
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2022-09-22 |
| First published | 2014-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Gulp Team |
| Maintainers | yocontra, phated |
| Keywords | streams, sink, through, writeable |

## Links

- npm: https://www.npmjs.com/package/lead
- Repository: https://github.com/gulpjs/lead
- Homepage: https://github.com/gulpjs/lead#readme
- Issues: https://github.com/gulpjs/lead/issues
- npm.io page: https://npm.io/package/lead

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2022-09-22
- 3.0.0 — 2020-04-29
- 2.0.0 — 2020-04-28
- 1.0.0 — 2017-04-28
- 0.0.0 — 2014-10-28

## README

<p align="center">
  <a href="https://gulpjs.com">
    <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  </a>
</p>

# lead

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Sink your streams.

## Usage

```js
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

<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/lead.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/lead
[npm-image]: https://img.shields.io/npm/v/lead.svg?style=flat-square

[ci-url]: https://github.com/gulpjs/lead/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/lead/dev?style=flat-square

[coveralls-url]: https://coveralls.io/r/gulpjs/lead
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/lead/master.svg?style=flat-square
<!-- prettier-ignore-end -->

---
_Source: https://npm.io/package/lead · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
