imagemagick-stream
Advanced tools
Comparing version 1.0.2 to 1.1.0
13
index.js
@@ -225,2 +225,6 @@ var PassThrough = require('stream').PassThrough; | ||
stdout.pipe(this.out); | ||
var stderr = proc.stderr; | ||
stderr.on('data', this.onerror); | ||
stderr.on('error', this.onerror); | ||
@@ -230,5 +234,14 @@ this.emit('spawn', proc); | ||
/** | ||
* Re-emit errors | ||
* | ||
* @param {Error|Buffer} err | ||
* @api private | ||
*/ | ||
onerror: function (err) { | ||
if (!isError(err)) err = new Error(err); | ||
if (!this.listeners('error')) throw err; | ||
this.emit('error', err); | ||
} | ||
}; |
{ | ||
"name": "imagemagick-stream", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Streaming Imagemagick api", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -31,3 +31,3 @@ # imagemagick-stream | ||
``` | ||
For freehand arguments, use `.options()`: | ||
For freehand arguments, use `.options()` | ||
``` js | ||
@@ -34,0 +34,0 @@ im('image.png') |
@@ -31,2 +31,12 @@ var assert = require('assert'); | ||
it('should emit errors from stderr', function (done) { | ||
var img = im(); | ||
img.write('invalid data'); | ||
img.end(); | ||
img.on('error', function (err) { | ||
assert(/^convert\:/.test(err.message)); | ||
done(); | ||
}); | ||
}); | ||
describe('.from()', function () { | ||
@@ -33,0 +43,0 @@ it('should read from the given path', function (done) { |
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
41051
358