# to-through

> Wrap a Readable stream in a Transform stream.

Latest version **3.0.0** (published 2022-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-through
pnpm add to-through
yarn add to-through
bun add to-through
```

## 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 | 3.0.0 |
| Published | 2022-09-07 |
| First published | 2017-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Gulp Team |
| Maintainers | yocontra, phated |
| Keywords | transform, readable, through, wrap |

## Links

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

## Dependencies (1)

- [streamx](https://npm.io/package/streamx.md) ^2.12.5

## 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

- 3.0.0 (latest) — 2022-09-07
- 2.0.0 — 2017-05-03
- 1.0.1 — 2017-05-03
- 1.0.0 — 2017-05-03

## README

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

# to-through

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

Wrap a `Readable` stream in a `Transform` stream.

## Usage

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

## License

MIT

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

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

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

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