Socket
Socket
Sign inDemoInstall

password-prompt

Package Overview
Dependencies
8
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    password-prompt

cross-platform masked or hidden prompt


Version published
Weekly downloads
2.2M
increased by0.68%
Maintainers
3
Install size
188 kB
Created
Weekly downloads
 

Package description

What is password-prompt?

The password-prompt npm package is designed to securely prompt for a password in a Node.js application. It hides the input as the user types, making it suitable for CLI applications where sensitive information needs to be entered by the user.

What are password-prompt's main functionalities?

Secure Password Input

This feature allows for the secure input of passwords. The code sample demonstrates how to prompt the user for a password without showing the input on the screen.

const passwordPrompt = require('password-prompt');

async function getPassword() {
  const password = await passwordPrompt('Password: ');
  console.log('Password entered:', password);
}

getPassword();

Other packages similar to password-prompt

Readme

Source

password-prompt

Node cross-platform password prompt.

Supported Environments:

  • Unix
  • TTY or non-TTY
  • cygwin
  • Git Bash
  • cmd.exe
  • PowerShell
  • cmder
  • Console2

API Reference

prompt -- Prompt for a password

Returns: Promise.<string> - input from user

ParamTypeDefaultDescription
[ask]stringprompt output
[options]Object
[options.method]string"mask"mask or hide

Example

let prompt = require('password-prompt')
let password = prompt('password: ')
// password: ******

Keywords

FAQs

Last updated on 25 Jul 2023

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