Gathering detailed insights and metrics for get-stdin-with-tty
Gathering detailed insights and metrics for get-stdin-with-tty
Gathering detailed insights and metrics for get-stdin-with-tty
Gathering detailed insights and metrics for get-stdin-with-tty
Get stdin as a string or buffer from pipe or TTY (moos fork)
npm install get-stdin-with-tty
Typescript
Module System
Min. Node Version
Node Version
NPM Version
78
Supply Chain
97.9
Quality
74.9
Maintenance
100
Vulnerability
100
License
JavaScript (96.68%)
TypeScript (3.32%)
Total Downloads
443,979
Last Day
430
Last Week
4,153
Last Month
20,740
Last Year
163,498
MIT License
2 Stars
68 Commits
1 Forks
2 Watchers
1 Branches
1 Contributors
Updated on Mar 23, 2020
Minified
Minified + Gzipped
Latest Version
6.0.0
Package Id
get-stdin-with-tty@6.0.0
Unpacked Size
7.76 kB
Size
3.39 kB
File Count
5
NPM Version
6.13.4
Node Version
12.16.1
Cumulative downloads
Total Downloads
Last Day
-35.5%
430
Compared to previous day
Last Week
-18.5%
4,153
Compared to previous week
Last Month
4.3%
20,740
Compared to previous month
Last Year
-9.3%
163,498
Compared to previous year
Get stdin as a string or buffer
$ npm install get-stdin-with-tty
1// example.js 2const getStdin = require('get-stdin-with-tty'); 3 4(async () => { 5 console.log(await getStdin()); 6})();
$ 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, unless options.tty
or getStdin.tty
is true.
Get stdin
as a Buffer
.
In a TTY context, a promise that resolves to an empty Buffer
is returned.
tty
| getStdin.tty
(Boolean) -
Set global TTY handling. When true, accepts input from TTY until a new line beginning with Ctrl-d or Ctrl-z is entered. Double Ctrl-d anywhere in the line also ends the stream. (Default = true
)
When enabled for the example above:
$ node example.js
foobar
barfoo
^d
// =>
foobar
barfoo
EOF
| getStdin.EOF
(String) - The end-of-file (aka EOT) character to use to signal end of stream. Defaults to Ctrl-d on *nix and cygwin, and Ctrl-z on Windows. Acceptable values:
getStdin.CTRL_D
- Ctrl-d (ASCII 04)getStdin.CTRL_Z
- Ctrl-z (ASCII 26)'*'
- Use both Ctrl-d and Ctrl-z1(win) c:\> node example.js 2foobar 3^z 4# => foobar
1$ node example.js 2foobar^d^d 3# => foobar
The moos fork includes support for reading stdin from TTY by default.
tty
option is now defaulted to true
. Double Ctrl-d in middle of line also ends stream.MIT © Sindre Sorhus © Moos
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/19 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More