New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minitask

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

minitask - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

lib/cache.js

@@ -155,3 +155,3 @@ var fs = require('fs'),

}
return (cacheMeta.taskResults[taskHash] ? cacheMeta.taskResults[taskHash].path : false);
return cacheMeta.taskResults[taskHash].path;
};

@@ -158,0 +158,0 @@

@@ -5,2 +5,11 @@ var fs = require('fs'),

var debugIdentities = [];
function debugId(obj) {
var index = debugIdentities.indexOf(obj);
if(index != -1) return index;
debugIdentities.push(obj);
return debugIdentities.length - 1;
}
exports.parallel = function(tasks, opts) {

@@ -66,7 +75,12 @@ var running = 0,

// read result from cache file
return function(out, done) {
var fn = function(out, done) {
// console.log('create', debugId(fn), task.inputFilePath);
fs.createReadStream(cacheFile)
.once('close', done)
.once('close', function() {
// console.log('in-close', debugId(fn), task.inputFilePath);
done();
})
.pipe(out, { end: false});
};
return fn;
}

@@ -115,3 +129,7 @@ return task;

// from fn(done) => fn(out, done)
return task(opts.output, onDone);
// console.log('run', debugId(task));
return task(opts.output, function() {
// console.log('done', debugId(task));
onDone();
});
};

@@ -118,0 +136,0 @@ }), function() {

@@ -44,2 +44,11 @@ var util = require('util'),

this.inputPaused = true;
// destroy the file handle on 'hit'
// as it will otherwise not be consumed properly and hence never closed
var self = this;
this.once('hit', function() {
if (self._input && self._input.destroy) {
self._input.destroy();
}
});
}

@@ -46,0 +55,0 @@

{
"name": "minitask",
"version": "0.1.0",
"version": "0.1.1",
"description": "A standard/convention for running tasks over a list of files based around Node core streams2",

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

@@ -69,2 +69,6 @@ var fs = require('fs'),

assert.ok(!cache.lookup(__dirname+'/fixtures/hash.txt', taskHash));
},
'can call Cache.lookup(url)': function() {
}

@@ -71,0 +75,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