https://github.com/fabiospampinato/stdin-blocker
A tiny library for blocking stdin keypresses, except for ctrl+c. Useful while displaying animations.
https://github.com/fabiospampinato/stdin-blocker
block cli ignore input prevent stdin terminal
Last synced: 21 days ago
JSON representation
A tiny library for blocking stdin keypresses, except for ctrl+c. Useful while displaying animations.
- Host: GitHub
- URL: https://github.com/fabiospampinato/stdin-blocker
- Owner: fabiospampinato
- License: mit
- Created: 2022-02-09T17:41:16.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T00:20:32.000Z (about 1 year ago)
- Last Synced: 2025-10-13T06:32:16.016Z (5 months ago)
- Topics: block, cli, ignore, input, prevent, stdin, terminal
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Stdin Blocker
A tiny library for blocking stdin keypresses, except for Ctrl+C. Useful while displaying animations.
## Install
```sh
npm install stdin-blocker
```
## Usage
```ts
import Blocker from 'stdin-blocker';
Blocker.isBlocked (); // => false, stdin input is not blocked
Blocker.block ();
Blocker.isBlocked (); // => true, stdin input is blocked
Blocker.unblock ();
Blocker.isBlocked (); // => false, stdin input is not blocked
Blocker.toggle ();
Blocker.isBlocked (); // => true, stdin input is blocked
```
## License
MIT © Fabio Spampinato