# ordered-through

> Transform streams with async functions, preserving order

Latest version **0.0.3** (published 2013-07-12) · MIT license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2013-07-12 |
| First published | 2013-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Julian Gruber |
| Maintainers | juliangruber |
| Keywords | stream, through, map, async |

## Links

- npm: https://www.npmjs.com/package/ordered-through
- Repository: https://github.com/juliangruber/ordered-through
- Issues: https://github.com/juliangruber/ordered-through/issues
- npm.io page: https://npm.io/package/ordered-through

## Dependencies (3)

- [through](https://npm.io/package/through.md) ~2.2.7
- [duplexer](https://npm.io/package/duplexer.md) ~0.1.0
- [ordered-emitter](https://npm.io/package/ordered-emitter.md) ~0.1.1

## 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.3 (latest) — 2013-07-12
- 0.0.2 — 2013-07-11
- 0.0.1 — 2013-04-01
- 0.0.0 — 2013-04-01

## README

# ordered-through

Transform streams with async functions, preserving order, no matter how long
each operation takes.

## Usage

```js
var through = require('ordered-through');

var ordered = through(function (chunk, cb) {
  // some async function
  setTimeout(function () {
    // emit transformed data
    cb(null, 'Chunk: ' + chunk);
  }, Math.random() * 100);
});

ordered.on('data', console.log);

for (var i = 0; i < 10; i++) ordered.write(i);
ordered.end();
```

output:

```
Chunk: 0
Chunk: 1
Chunk: 2
Chunk: 3
Chunk: 4
Chunk: 5
Chunk: 6
Chunk: 7
Chunk: 8
Chunk: 9
```

## API

### OrderedThrough(fn)

Returns a through stream.

Calls `fn` with every chunk that gets written to it and a callback function
that you need to call with `err` and `chunk` for every chunk you transformed.

## Installation

With [npm](http://npmjs.org) do

```bash
$ npm install ordered-through
```

## License

(MIT)

Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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