BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / getpass / README.md

README.md

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
README.md 774 B Download Raw

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
Source
1## getpass
2
3Get a password from the terminal. Sounds simple? Sounds like the `readline`
4module should be able to do it? NOPE.
5
6## Install and use it
7
8```bash
9npm install --save getpass
10```
11
12```javascript
13const mod_getpass = require('getpass');
14```
15
16## API
17
18### `mod_getpass.getPass([options, ]callback)`
19
20Gets a password from the terminal. If available, this uses `/dev/tty` to avoid
21interfering with any data being piped in or out of stdio.
22
23This function prints a prompt (by default `Password:`) and then accepts input
24without echoing.
25
26Parameters:
27
28 * `options`, an Object, with properties:
29 * `prompt`, an optional String
30 * `callback`, a `Func(error, password)`, with arguments:
31 * `error`, either `null` (no error) or an `Error` instance
32 * `password`, a String