# parallel-transform

> Transform stream that allows you to run your transforms in parallel without changing the order

Latest version **1.2.0** (published 2019-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install parallel-transform
pnpm add parallel-transform
yarn add parallel-transform
bun add parallel-transform
```

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2019-09-05 |
| First published | 2013-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/parallel-transform) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Author | Mathias Buus Madsen |
| Maintainers | mafintosh |
| Keywords | transform, stream, parallel, preserve, order |

## Links

- npm: https://www.npmjs.com/package/parallel-transform
- Repository: https://github.com/mafintosh/parallel-transform
- Homepage: https://github.com/mafintosh/parallel-transform#readme
- Issues: https://github.com/mafintosh/parallel-transform/issues
- npm.io page: https://npm.io/package/parallel-transform

## Dependencies (3)

- [cyclist](https://npm.io/package/cyclist.md) ^1.0.1
- [inherits](https://npm.io/package/inherits.md) ^2.0.3
- [readable-stream](https://npm.io/package/readable-stream.md) ^2.1.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

- 1.2.0 (latest) — 2019-09-05
- 1.1.0 — 2016-11-08
- 1.0.0 — 2016-05-06
- 0.2.2 — 2013-12-13
- 0.2.1 — 2013-08-22
- 0.2.0 — 2013-08-10
- 0.1.4 — 2013-07-30
- 0.1.3 — 2013-07-30
- 0.1.2 — 2013-07-30
- 0.1.1 — 2013-07-30
- 0.1.0 — 2013-07-30

## README

# parallel-transform

[Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) for Node.js that allows you to run your transforms
in parallel without changing the order of the output.

	npm install parallel-transform

It is easy to use

``` js
var transform = require('parallel-transform');

var stream = transform(10, function(data, callback) { // 10 is the parallism level
	setTimeout(function() {
		callback(null, data);
	}, Math.random() * 1000);
});

for (var i = 0; i < 10; i++) {
	stream.write(''+i);
}
stream.end();

stream.on('data', function(data) {
	console.log(data); // prints 0,1,2,...
});
stream.on('end', function() {
	console.log('stream has ended');
});
```

If you run the above example you'll notice that it runs in parallel
(does not take ~1 second between each print) and that the order is preserved

## Stream options

All transforms are Node 0.10 streams. Per default they are created with the options `{objectMode:true}`.
If you want to use your own stream options pass them as the second parameter

``` js
var stream = transform(10, {objectMode:false}, function(data, callback) {
	// data is now a buffer
	callback(null, data);
});

fs.createReadStream('filename').pipe(stream).pipe(process.stdout);
```

### Unordered
Passing the option `{ordered:false}` will output the data as soon as it's processed by a transform, without waiting to respect the order.

## License

MIT

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