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

Add inputFile option #542

Merged
merged 4 commits into from Mar 9, 2023
Merged

Add inputFile option #542

merged 4 commits into from Mar 9, 2023

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Mar 7, 2023

Discussed in #534 (comment)

This adds an inputFile option to pipe a file's contents to the process stdin. It works both in sync and async modes.

@ehmicky ehmicky mentioned this pull request Mar 7, 2023
@@ -260,13 +260,23 @@ export type Options<EncodingType = string> = {
Write some input to the `stdin` of your binary.
*/
readonly input?: string | Buffer | ReadableStream;

/**
Use a file as input to the the `stdin` of your binary.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mention input somehow. Maybe using a @see annotation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a Tip like the input option. Would that work?

lib/stream.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 0726126 into main Mar 9, 2023
20 checks passed
@sindresorhus sindresorhus deleted the input-file branch March 9, 2023 04:44
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 this pull request may close these issues.

None yet

2 participants