What you're probably seeing in the output is convert.stderr
because you are piping it to process.stderr
, which is the error output of your child process' master. When you spawn a child process, by default, no stdio
is handled.
var spawn = require('child_process').spawn'
var child = spawn('gm', ['convert']);
The code that you've shown is that you're directly piping the child's stderr
to the main process' stderr
and piping stdout
to your outStream
. That means the only possible output you can see is convert.stderr
.
To fix this, ignore stderr
.
var obj = {
outStream: new BufferList()
};
var spawn = require('child_process').spawn'
var child = spawn('gm', ['convert'], {
stdio: ['pipe', obj.outStream, 'ignore']
});
With this, you have the stdin
stream as it normally is, stdout
piped to obj.outStream
m and stderr
ignored.