Skip to content

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

Merged
sindresorhus merged 4 commits intosindresorhus:mainfrom
v1rtl:remove-get-stdin
Nov 10, 2025
Merged

Replace get-stdin with Node's streamConsumers.buffer#24
sindresorhus merged 4 commits intosindresorhus:mainfrom
v1rtl:remove-get-stdin

Conversation

@v1rtl
Copy link
Copy Markdown
Contributor

@v1rtl v1rtl commented May 19, 2025

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():

Comment thread cli.js Outdated
@v1rtl
Copy link
Copy Markdown
Contributor Author

v1rtl 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
Copy Markdown

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?

@v1rtl
Copy link
Copy Markdown
Contributor Author

v1rtl commented May 20, 2025

Sure, will add a test case now

@v1rtl v1rtl requested a review from watson May 20, 2025 12:49
@v1rtl
Copy link
Copy Markdown
Contributor Author

v1rtl commented Jul 8, 2025

is there anything left to be added @watson ?

@sindresorhus sindresorhus merged commit 0f5077b into sindresorhus:main Nov 10, 2025
2 checks passed
@v1rtl v1rtl deleted the remove-get-stdin branch November 11, 2025 00:38
@v1rtl
Copy link
Copy Markdown
Contributor Author

v1rtl commented Mar 7, 2026

Seems like this fix has never been released, would it be possible to publish it on npm?

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.

3 participants