Back to Explore

sindresorhus/stdin-discarder

GitHub
1 updates · last 90 days1 watchersOpen source

Last release: 1 month ago

stdin-discarder discards standard input (stdin) so it does not interfere with command output, while still allowing Ctrl+C to work. It is useful when writing CLI tools with live stdout output like spinners, helping prevent keypresses from causing visual glitches. This has no effect on Windows.

Project status

  • Actively maintained, with a very recent upstream push on 2026-04-14 and patch releases continuing through v0.3.2.
  • Apparent updates cadence is roughly every 2 to 3 months (v0.3.0 on 2025-11-04, v0.3.1 on 2026-01-08, v0.3.2 on 2026-04-14).

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v0.3.2

    1 month ago

    v0.3.2 changes how Ctrl+C (ETX/0x03) is handled when stdin is discarded. Instead of conditionally emitting a SIGINT event when listeners are present, the code now always sends a real SIGINT process signal.

  • v0.3.1

    5 months ago

    v0.3.1 is a small patch release intended to address a case where the process could hang when stdin remains open. The code change removes a resume call path in StdinDiscarder stop logic and adds a regression test to ensure resume is not triggered when stdin is already flowing.

  • v0.3.0

    7 months ago

    Version 0.3.0 enhances stdin handling by preserving the prior paused state when stopping. The implementation also adds safer stdin/raw-mode restoration and improves Ctrl+C (ETX) handling across different chunk types.

    Breaking
  • v0.2.2

    1/6/2024

    v0.2.2 is a small patch release intended to fix an issue where an interactive prompt fails to work if it appears after enabling stdin discarding. The code changes are confined to stream lifecycle handling in index.js, plus a package version bump.

  • v0.2.1

    12/23/2023

    v0.2.1 is a small patch release focused on fixing a case where processes using stdin-discarder might not exit. The code change specifically unrefs stdin after enabling raw mode and attaching the input handler.

  • v0.2.0

    12/15/2023

    Release v0.2.0 mainly drops support for older Node.js versions and replaces the stdin discarding implementation. The code refactor changes how Ctrl+C (ETX) is detected and how stdin is handled while discarding.

    Breaking
  • v0.1.0

    7/26/2022

    Release v0.1.0 was published on 2022-07-26, but the provided release notes contain no actionable information beyond a placeholder emoji. There are no documented new features, bug fixes, breaking changes, or security updates in the text supplied.