1. stdin-discarder
Discard stdin input except for Ctrl+C
stdin-discarder
Package: stdin-discarder
Created by: sindresorhus
Last modified: Sat, 06 Jan 2024 09:21:37 GMT
Version: 0.2.2
License: MIT
Downloads: 6,560,186
Repository: https://github.com/sindresorhus/stdin-discarder

Install

npm install stdin-discarder
yarn add stdin-discarder

stdin-discarder

Discard stdin input except for Ctrl+C

This can be useful to prevent stdin input from interfering with stdout output. For example, you are showing a spinner, and if the user presses a key, it would interfere with the spinner, causing visual glitches. This package prevents such problems.

This has no effect on Windows as there is no good way to implement discarding stdin properly there.

This package is used by ora for its discardStdin option.

Install

 npm install stdin-discarder

Usage

 import stdinDiscarder from 'stdin-discarder';

stdinDiscarder.start();

API

stdinDiscarder.start()

Start discarding stdin.

stdinDiscarder.stop()

Stop discarding stdin.

  • hook-std - Hook and modify stdout and stderr

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin