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
npm install get-stdin-with-tty
76.1
Supply Chain
97.9
Quality
75.1
Maintenance
100
Vulnerability
100
License
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
68 Commits
1 Forks
3 Watching
1 Branches
1 Contributors
Updated on 23 Mar 2020
JavaScript (96.68%)
TypeScript (3.32%)
Cumulative downloads
Total Downloads
Last day
-37.8%
352
Compared to previous day
Last week
1.8%
2,628
Compared to previous week
Last month
7.6%
12,697
Compared to previous month
Last year
-1.3%
149,609
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
Found 1/19 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- 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
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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