Skip to content

oxfn/password-prompt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Param Type Default Description
[ask] string prompt output
[options] Object
[options.method] string "mask" mask / hide / choke

Supported masking methods

  • mask - Mask your password with * after Enter (default)
  • hide - Mask your password with * immediately on input
  • choke - Do not show any input

Example

let prompt = require('password-prompt')
let password = prompt('password: ')
let password = prompt('password: ', { method: 'mask' })
let password = prompt('password: ', { method: 'hide' })
let password = prompt('password: ', { method: 'choke' })
// password: ******

About

Node cross-platform password prompt

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%