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 - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

7

index.js

@@ -60,2 +60,3 @@ var stream = require('stream');

callback();
if (writable._writableState.buffer.length === 0) writable.emit('empty');
};

@@ -66,2 +67,8 @@

writable.end = function(chunk, enc, callback) {
if (writable._writableState.buffer.length) {
return writable.once('empty', function() {
writable.end(chunk, enc, callback);
});
}
if (writable.pending) {

@@ -68,0 +75,0 @@ return writable.once('free', function() {

2

package.json
{
"name": "parallel-stream",
"version": "1.0.0",
"version": "1.1.0",
"description": "Concurrent transform stream",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,8 +18,15 @@ var stream = require('stream');

worker.data.push(Number(data.toString()));
setTimeout(function() {
if (worker.err) callback(worker.err);
function work(data) {
if (worker.err) {
console.log('sending work error');
callback(worker.err);
}
if (err) callback(err);
else callback(null, data);
worker.running--;
}, pauseTime, data);
}
if (pauseTime) setTimeout(work, pauseTime, data);
else work(data);
};

@@ -201,2 +208,23 @@ worker.running = 0;

});
test('[writable: ' + concurrency + '] synchronous writer', function(assert) {
var work = timedWorker(0);
var read = timedReadable(20)
.on('end', function() {
work.err = new Error('post .end() failure');
});
setTimeout(function() {
read.stop = true;
}, 2000);
read.pipe(parallel.writable(work, options))
.on('error', function(err) {
assert.ifError(err, 'should not error');
})
.on('finish', function() {
assert.pass('finish event should fire');
assert.end();
});
});
}

@@ -203,0 +231,0 @@

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