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: 4 months 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T00:20:32.000Z (5 months ago)
- Last Synced: 2025-01-20T12:38:13.466Z (4 months ago)
- Topics: block, cli, ignore, input, prevent, stdin, terminal
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- 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