An open API service indexing awesome lists of open source software.

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.

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