promisepipe
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,2 +8,10 @@ | ||
return Q.promise(function(resolve, reject) { | ||
// process.stdout and process.stderr are not closed or ended | ||
// after piping like other streams. So we must resolve them | ||
// manually. | ||
if (stream === process.stdout || stream === process.stderr) { | ||
return resolve(); | ||
} | ||
stream.on("error", function(streamErr) { | ||
@@ -10,0 +18,0 @@ var err = new Error(streamErr.message); |
{ | ||
"name": "promisepipe", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Pipe node.js streams safely with Promises", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha test.js" | ||
}, | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -1,3 +0,1 @@ | ||
# promisePipe | ||
@@ -15,3 +13,3 @@ | ||
It returns a promise. On success the resolved value will be an array of the | ||
streams passed in. When rejected the an error object is created with following | ||
streams passed in. When rejected an error object is created with following | ||
keys: | ||
@@ -72,3 +70,3 @@ | ||
Which is imo repeative and cumbersome. | ||
Which is imo repeative and cumbersome (at least when you want to use promises). | ||
@@ -56,2 +56,11 @@ /*global it, describe, beforeEach */ | ||
["stdout", "stderr"].forEach(function(stdio) { | ||
it("can pipe to " + stdio, function(done) { | ||
var input = fs.createReadStream(INPUT); | ||
promisePipe(input, process[stdio]).done(function() { | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it("can handle errors from source", function(done) { | ||
@@ -58,0 +67,0 @@ var input = fs.createReadStream("bad"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
8392
133
1
71