mock-stdin is a Node.js package that simplifies testing command-line interfaces. It allows you to programmatically mock user input fed to stdin, enabling automated testing of interactive CLI tools without manual intervention. The package provides an easy-to-use API for simulating keypresses, text input, and other standard input events. This ensures consistent and reproducible test results, making your CLI applications more robust and reliable. It offers precise control over input streams, making it an invaluable tool for comprehensive CLI application testing.
The npm package mock-stdin had initial releases in October 2014 with 5 versions. A single version was released in September 2016, and version 1.0.0 was released in November 2019. No releases have occurred since November 2019, including throughout all of 2020, 2021, 2022, 2023, 2024 and up to August 2025. The package appears to be inactive.
Mock-stdin npm package downloads peaked in late 2024, reaching nearly one million in November. A decline began in December 2024 and continued into 2025, with fluctuations. June 2025 saw a significant rebound. August 2025 downloads are incomplete and significantly lower.