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

File input/output #19

Open
ehmicky opened this issue Aug 22, 2024 · 2 comments
Open

File input/output #19

ehmicky opened this issue Aug 22, 2024 · 2 comments

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented Aug 22, 2024

I would suggest not implementing passing a file to stdin/stdout/stderr because:

  • This can be done by users using fs.createReadStream() and fs.createWriteStream().
  • Implementing it is not 100% trivial as it requires also:
    • Potentially, allowing both file paths and file URLs
    • Listening for stream errors
    • Cleaning up the stream if the subprocess fails

Thoughts?

@sindresorhus
Copy link
Owner

Yeah, we can leave it out for now. But I prefer to keep this issue open.

@sindresorhus
Copy link
Owner

Maybe worth opening an issue on Node.js about this? Would be useful if stdio[n] accepted:

  • Uint8Array: For when you already have a loaded buffer.
  • FileHandle: ?
  • WebStream: For completeness.

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

2 participants