get-stdin
Advanced tools
Get stdin as a string or buffer
Weekly downloads
Changelog
https://github.com/sindresorhus/get-stdin/compare/v8.0.0...v9.0.0
Readme
Get stdin as a string or buffer
$ npm install get-stdin
// example.js
import getStdin from 'get-stdin';
console.log(await getStdin());
//=> 'unicorns'
$ echo unicorns | node example.js
unicorns
Both methods returns a promise that is resolved when the end
event fires on the stdin
stream, indicating that there is no more data to be read.
Get stdin
as a string
.
In a TTY context, a promise that resolves to an empty string
is returned.
Get stdin
as a Buffer
.
In a TTY context, a promise that resolves to an empty Buffer
is returned.
Get stdin as a string or buffer
The npm package get-stdin receives a total of 14,982,497 weekly downloads. As such, get-stdin popularity was classified as popular.
We found that get-stdin demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.