Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

askpassword

Package Overview
Dependencies
Maintainers
33
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

askpassword

A password prompt that does print data to the TTY

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39K
decreased by-10.58%
Maintainers
33
Weekly downloads
 
Created
Source

askpassword

A password prompt that does not print data to the TTY.

import askpassword from 'askpassword';

console.log('Please enter a password:');
const password = await askpassword(process.stdin);
console.log('You entered the following password:', password.toString());

The stream passed to askpassword can be any kind of Readable stream. If it is a TTY, askpassword will temporarily remove all other 'data' and 'readable' listeners from it, and set the TTY into raw mode if it has not been in raw mode to begin with.

Why not use read instead?

Because read does not work inside a Node.js REPL.

LICENSE

Apache-2.0

Keywords

FAQs

Package last updated on 10 May 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc