@cjser/stdin-discarder
v0.3.2-cjser.2
Published
Discard stdin input except for Ctrl+C
Maintainers
Readme
stdin-discarder
Discard stdin input except for Ctrl+C
This can be useful to prevent stdin input from interfering with stdout output. For example, you are showing a spinner, and if the user presses a key, it would interfere with the spinner, causing visual glitches. This package prevents such problems.
This has no effect on Windows as there is no good way to implement discarding stdin properly there.
This package is used by ora for its discardStdin option.
Install
npm install stdin-discarderUsage
import stdinDiscarder from 'stdin-discarder';
stdinDiscarder.start();API
stdinDiscarder.start()
Start discarding stdin.
stdinDiscarder.stop()
Stop discarding stdin.
Related
- hook-std - Hook and modify stdout and stderr
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/stdin-discarder
