A tiny library for blocking stdin keypresses, except for Ctrl+C. Useful while displaying animations.
npm install stdin-blockerA tiny library for blocking stdin keypresses, except for Ctrl+C. Useful while displaying animations.
``sh`
npm install stdin-blocker
`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
``
MIT © Fabio Spampinato