Socket
Socket
Sign inDemoInstall

stdin-discarder

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stdin-discarder

Discard stdin input except for Ctrl+C


Version published
Weekly downloads
1.6M
increased by0.54%
Maintainers
1
Install size
3.95 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 06 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc