# arraystream

> ReadableStream of arrays and hash variables.

Latest version **0.0.5** (published 2012-03-07) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2012-03-07 |
| First published | 2011-11-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | SHIN Suzuki |
| Maintainers | shinout |
| Keywords | ReadableStream, array, object, stream |

## Links

- npm: https://www.npmjs.com/package/arraystream
- Repository: https://github.com/shinout/ArrayStream
- Issues: https://github.com/shinout/ArrayStream/issues
- npm.io page: https://npm.io/package/arraystream

## 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.5 (latest) — 2012-03-07
- 0.0.4 — 2012-03-07
- 0.0.3 — 2011-11-21
- 0.0.2 — 2011-11-18
- 0.0.1 — 2011-11-16

## README

ArrayStream.js 0.0.5
==========
[Node.js] ReadableStream from array (or hash variable)


Overview
----------------
## Installation ##

    $ git clone git://github.com/shinout/ArrayStream.git

    OR

    $ npm install arraystream

## Usage ##
### with Array ###

    var ArrayStream = require('arraystream');
    var stream = ArrayStream.create(['hoge', 'fuga', 'piyo']);

    stream.on('data', function(value, key) {
      console.log(value); // hoge, fuga, piyo
      console.log(key);   // 0,    1,    2
    });

    stream.on('end', function() { // emitted at the end of iteration
      console.log('end');
    });

    stream.on('error', function(e) { // emitted when an error occurred
      console.log(e);
    });




### with Object ###
    var ArrayStream = require('arraystream');
    var objstream = new ArrayStream({a:'hoge', b:'fuga', c:'piyo']);

    objstream.on('data', function(value, key) {
      console.log(key);   // a,    b,    c
      console.log(value); // hoge, fuga, piyo
    });

    objstream.on('end', function() { // emitted at the end of Object
      console.log('end');
    });

    objstream.on('error', function(e) { // emitted when an error occurred
      console.log(e);
    });


### syntax sugar (forEach) ###

    var arr = ['hoge', 'fuga', 'piyo'];
    var stream = ArrayStream.forEach(arr, function(value, key) {
      console.log(value); // hoge, fuga, piyo
      console.log(key);   // 0,    1,    2
    });

    stream.on('end', function() { // emitted at the end of iteration
      console.log('end');
    });

    stream.on('error', function(e) { // emitted when an error occurred
      console.log(e);
    });

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