8000 Replace `get-stdin` with Node's `streamConsumers.buffer` by talentlessguy · Pull Request #24 · sindresorhus/open-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace get-stdin with Node's streamConsumers.buffer #24

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

talentlessguy
Copy link

This pull request removes get-stdin in favor of built-in streamConsumers.buffer.

The utility is available since Node 16, and the package targets Node 18+, which makes the change backwards compatible.

From get-stdin's readme:

You can now accomplish this natively in Node.js using streamConsumers.text() or streamConsumers.buffer():

@talentlessguy
Copy link
Author
talentlessguy commented May 20, 2025

I verified that the PR works as intended by doing cat cli.js | node ./cli.js, it properly opened the file

@watson
Copy link
watson commented May 20, 2025

Due to the missing process.stdin argument in your original version of this PR, I discovered that there's no test for the STDIN case. Would you be up for adding one in this PR?

@talentlessguy
Copy link
Author

Sure, will add a test case now

@talentlessguy talentlessguy requested a review from watson May 20, 2025 12:49
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.

2 participants
0