# stdin-blocker

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

Latest version **2.0.1** (published 2025-01-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install stdin-blocker
pnpm add stdin-blocker
yarn add stdin-blocker
bun add stdin-blocker
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-01-12 |
| First published | 2022-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | fabiospampinato |
| Keywords | cli, terminal, stdin, input, block, prevent, ignore |

## Links

- npm: https://www.npmjs.com/package/stdin-blocker
- Repository: https://github.com/fabiospampinato/stdin-blocker
- Homepage: https://github.com/fabiospampinato/stdin-blocker#readme
- Issues: https://github.com/fabiospampinato/stdin-blocker/issues
- npm.io page: https://npm.io/package/stdin-blocker

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2025-01-12
- 2.0.0 — 2022-04-06
- 1.0.0 — 2022-02-09

## 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

---
_Source: https://npm.io/package/stdin-blocker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
