# to-stream

> Turn an array to a Node.js stream

Latest version **0.0.2** (published 2014-03-14) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-03-14 |
| First published | 2014-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Po-Ying Chen |
| Maintainers | poying |
| Keywords | stream, streamify |

## Links

- npm: https://www.npmjs.com/package/to-stream
- Repository: https://github.com/poying/node-to-stream
- Issues: https://github.com/poying/node-to-stream/issues
- npm.io page: https://npm.io/package/to-stream

## Dependencies (1)

- [readable-stream](https://npm.io/package/readable-stream.md) ~1.0.26-2

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

- 0.0.2 (latest) — 2014-03-14
- 0.0.1 — 2014-03-14
- 0.0.0 — 2014-03-14

## README

to-stream
---------

[![Build Status](https://travis-ci.org/poying/node-to-stream.png)](https://travis-ci.org/poying/node-to-stream)

Turn an array to a Node.js stream.

> The array can contains `Promise`, `Generator` and `GeneratorFunction`

## Install

```bash
$ npm install --save to-stream
```

## Example

```javascript
var Promise = require('promise');
var toStream = require('to-stream');

var promise = new Promise(function (resolve, reject) {
  setTimeout(function () {
    resolve('b');
  });
});

var gen = function *() {
  yield 'c';
  yield 'd';
};

toStream(['a', null, promise, gen])
  .on('data', function (data) {
    if (toStream.isNull(data)) {
      console.log('null');
    } else {
      console.log(data);
    }
  });
```

## API

### toStream(Array)
### toStream(Generator)
### toStream(GeneratorFunction)
### toStream.isNull()
### toStream.isUndefined()

## License

The MIT License (MIT)

[http://poying.mit-license.org/](http://poying.mit-license.org/)

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