This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
spawn() with merged stdout and stderr #5831
Comments
From the #libuv room:
|
A test of the proposed API: https://gist.github.com/isaacs/5970659 |
@isaacs with that API would it be possible to pass, say // parent
var options = { stdio: [null, '&4', null, 'pipe'] };
var args = [ /* ... */ ];
var proc = child_process.spawn(cmd, args, options);
var pipe = proc.stdio[3];
pipe.write(Buffer('awesome'));
// child
var pipe = new net.Socket({ fd: 3 });
pipe.on('data', function(buf) {
// do whatever
}); |
@trevnorris Well, in that example, that'd be an error, because there is no |
Erm.. Yeah. |
Then yes, that would work. Effectively, EDIT: Correct stdio FDs |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It would be pretty amazeballs to have the option of spawning a subprocess with
stdout
andstderr
merged into a single stream. The shell analogue is basically:someprocess 2>&1
Or, in Java parlance,
redirectErrorStream(true)
on aProcessBuilder
.This would hopefully take the form of something I can pass in the
stdio
array tochild_process.spawn()
.The text was updated successfully, but these errors were encountered: