Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parallel-stream

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parallel-stream

Concurrent transform stream

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-22.97%
Maintainers
1
Weekly downloads
 
Created
Source

parallel-stream

build status

A transform stream that processes chunks concurrently. Stream order is not preserved.

Example usage

var Parallel = require('parallel-stream');
var util = require('util');
var fs = require('fs');

util.inherits(MyStream, Parallel);
function MyStream(concurrency, options) {
  Parallel.call(this, concurrency, options);
}

MyStream.prototype._process = function(chunk, enc, callback) {
  var _this = this;
  processChunkAsync(chunk, function(err, result) {
    if (err) return callback(err);
    _this.push(result);
    callback();
  });
}

// Process up to ten chunks simultaneously
var myStream = new MyStream(10);
fs.createReadStream('/some/file')
  .pipe(myStream)
  .pipe(process.stdout);

FAQs

Package last updated on 17 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc