Socket
Socket
Sign inDemoInstall

getpass

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

getpass

getpass for node.js

    0.1.7latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
14,801,365
decreased by-13.67%

Weekly downloads

Package description

What is getpass?

The getpass npm package is used to securely prompt for a user's password in a Node.js application. It can be used to handle password input without echoing the password back to the console, thus providing a more secure way to collect sensitive information from users.

What are getpass's main functionalities?

Get User Password

This feature allows you to prompt the user for a password without echoing it to the console. The password is passed to a callback function.

const getpass = require('getpass');
getpass.getPass('Password: ', function(err, password) {
  if (err) throw err;
  console.log('Your password is: ' + password);
});

Other packages similar to getpass

Readme

Source

getpass

Get a password from the terminal. Sounds simple? Sounds like the readline module should be able to do it? NOPE.

Install and use it

npm install --save getpass
const mod_getpass = require('getpass');

API

mod_getpass.getPass([options, ]callback)

Gets a password from the terminal. If available, this uses /dev/tty to avoid interfering with any data being piped in or out of stdio.

This function prints a prompt (by default Password:) and then accepts input without echoing.

Parameters:

  • options, an Object, with properties:
    • prompt, an optional String
  • callback, a Func(error, password), with arguments:
    • error, either null (no error) or an Error instance
    • password, a String

FAQs

Last updated on 25 Apr 2017

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the 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