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

result.stdio and error.stdio. #665

Closed
ehmicky opened this issue Jan 9, 2024 · 2 comments · Fixed by #676
Closed

result.stdio and error.stdio. #665

ehmicky opened this issue Jan 9, 2024 · 2 comments · Fixed by #676

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented Jan 9, 2024

We currently return the child process' stdout and stderr, as a property to the result and error objects.
We could do the same for the other file descriptors (3, 4, etc.), using childProcess.stdio. This would useful to any users writing to custom file descriptors.

It would behave just like stdout and stderr when it comes to buffering and encoding. It would in fact mostly use the same existing underlying logic, so the implementation would be fairly lightweight.

Just like stdout and stderr, it would be undefined when using inherit, ignore, ipc, etc. since those do leave childProcess.stdio[*] as null.

childProcess.spawnSync() actually does exactly this.

What do you think @sindresorhus?

@sindresorhus
Copy link
Owner

👍

@ehmicky
Copy link
Collaborator Author

ehmicky commented Jan 11, 2024

Done in #676.

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

Successfully merging a pull request may close this issue.

2 participants