npm.io
2.0.1 • Published 1 year ago

stdin-blocker

Licence
MIT
Version
2.0.1
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
1

Stdin Blocker

A tiny library for blocking stdin keypresses, except for Ctrl+C. Useful while displaying animations.

Install

npm install stdin-blocker

Usage

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

Keywords