GitShow/sindresorhus/get-stdin
sindresorhus

get-stdin

Get stdin as a string or buffer

by sindresorhus
Star on GitHubForknpm

JavaScript

350 stars29 forks11 contributorsQuiet · 6mo agoSince 2014v10.0.0MIT

Meet the team

See all 11 on GitHub →
sindresorhus
sindresorhus54 contributions
kevva
kevva3 contributions
coreyfarrell
coreyfarrell1 contribution
BendingBender
BendingBender1 contribution
Ethan-Arrowood
Ethan-Arrowood1 contribution
javiercejudo
javiercejudo1 contribution
lukechilds
lukechilds1 contribution
ntwb
ntwb1 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
trufae
Why is this module impeding me to slurp from tty?ClosedIssue

What's the point of behaving differently depending if stdin is a terminal or not? I think this is not the intended default behaviour and it should be left optional to the user. But if I run getStdin() i expect to slurp until EOF happens, even if thats typed by the user or coming from a pipe. https://github.com/sindresorhus/get-stdin/blob/master/index.js#L34

trufae · 6mo ago
lukechilds
When executable is spawned from node if there is no stdin getStdin() never resolvesClosedIssue

If there is no file option set my CLI app falls back to . I check if the result of the file read or is falsey and if so I show the help message. This works fine when used for real in a shell but when I try to write a test for it, it just hangs. It seems if I spawn my CLI app from node, returns a promise that never resolves. For example: But if I run this from node: I get nothing. Not sure if possibly related to #1. Is this expected behaviour or a bug?

lukechilds · 11mo ago
jcbhmr
Add note about `node:stream/consumers`ClosedIssue

Added in v16.7.0, there's now a function that returns a promise similar to from the API. https://nodejs.org/api/webstreams.html#utility-consumers ex: I think it would be a good idea to add a note (not necessarily a recommendation one way or the other; just a a note) to inform users of this alternative native Node.js way to get stdin as a string. This is just an idea and you may not want to add this and instead keep the readme very deliberately bare. idk. This is just a suggestion.

jcbhmr · 2y ago
Structured data for AI agents

Repository: sindresorhus/get-stdin. Description: Get stdin as a string or buffer Stars: 350, Forks: 29. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v10.0.0 (6mo ago). Open PRs: 0, open issues: 0. Last activity: 6mo ago. Community health: 85%. Top contributors: sindresorhus, kevva, coreyfarrell, BendingBender, Ethan-Arrowood, javiercejudo, lukechilds, ntwb, fisker, ChALkeR.

·@ofershap

Replace github.com with gitshow.dev