Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to deprecated child_process.spawn customFds option #542

Closed
knownasilya opened this issue Jan 21, 2015 · 5 comments
Closed

Alternative to deprecated child_process.spawn customFds option #542

knownasilya opened this issue Jan 21, 2015 · 5 comments

Comments

@knownasilya
Copy link

So customFds is deprecated, but there is no alternative. Main use case is preserving stdout/stderr colors when executing commands from node/io.

nodejs/node-v0.x-archive#2754

@ralphtheninja
Copy link
Contributor

@knownasilya You should use stdio property instead https://iojs.org/api/child_process.html#child_process_options_stdio

In this case { stdio: 'inherit' }

@knownasilya
Copy link
Author

Yes that works, although now there is no control over what happens during the stdout/err data flow. So it's a trade-off.

@sam-github
Copy link
Contributor

@knownasilya could you elaborate on what you mean by "no control"? You get streams, don't they allow flow control?

@knownasilya
Copy link
Author

@sam-github when using the above option, e.g. { stdio: 'inherit' }, you get null values for stdout and stderr stream objects.

@piscisaureus
Copy link
Contributor

when using the above option, e.g. { stdio: 'inherit' }, you get null values for stdout and stderr stream objects.

Just as you would get when using customFds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants