# prompt-password

> Password prompt. Can be used as a standalone prompt, or as a plugin for [Enquirer].

Latest version **1.2.0** (published 2017-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install prompt-password
pnpm add prompt-password
yarn add prompt-password
bun add prompt-password
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-07-08 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jon Schlinkert |
| Maintainers | doowb, jonschlinkert |
| Keywords | answer, answers, ask, checkbox, choice, cli, command, enquirer, enquirerprompt, input, inquire, inquirer, interact, list, menu, password, prompt, prompts, question, readline, stdin, stdout, terminal, tty, ui |

## Links

- npm: https://www.npmjs.com/package/prompt-password
- Repository: https://github.com/enquirer/prompt-password
- Issues: https://github.com/enquirer/prompt-password/issues
- npm.io page: https://npm.io/package/prompt-password

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.6.8
- [prompt-base](https://npm.io/package/prompt-base.md) ^4.0.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-07-08
- 1.1.0 — 2017-06-05
- 1.0.2 — 2017-05-23
- 1.0.1 — 2017-05-23
- 1.0.0 — 2017-05-22
- 0.1.1 — 2016-10-19
- 0.1.0 — 2016-10-13
- 0.0.1 — 2016-10-13

## README

# prompt-password [![NPM version](https://img.shields.io/npm/v/prompt-password.svg?style=flat)](https://www.npmjs.com/package/prompt-password) [![NPM monthly downloads](https://img.shields.io/npm/dm/prompt-password.svg?style=flat)](https://npmjs.org/package/prompt-password) [![NPM total downloads](https://img.shields.io/npm/dt/prompt-password.svg?style=flat)](https://npmjs.org/package/prompt-password) [![Linux Build Status](https://img.shields.io/travis/enquirer/prompt-password.svg?style=flat&label=Travis)](https://travis-ci.org/enquirer/prompt-password)

> Password prompt. Can be used as a standalone prompt, or as a plugin for [Enquirer](http://enquirer.io).

![prompt-password example](https://raw.githubusercontent.com/enquirer/prompt-password/master/docs/example.gif)

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save prompt-password
```

## Usage

```js
var Prompt = require('..');
var prompt = new Prompt({
  type: 'password',
  message: 'Enter your password please',
  name: 'password'
});

prompt.run()
  .then(function(answers) {
    console.log(answers)
  });
```

### mask function

Use [prompt-password-strength](https://github.com/enquirer/prompt-password-strength), or pass a function to customize how the input is masked:

```js
var Prompt = require('..');
var prompt = new Prompt({
  type: 'password',
  message: 'Enter your password please',
  name: 'password',
  mask: function(input) {
    return '█' + new Array(String(input).length).join('█');
  }
});

prompt.run()
  .then(function(answers) {
    console.log(answers)
  });
```

## Enquirer usage

Use the `.register` method to add the "password" prompt type to [enquirer](http://enquirer.io):

```js
var Enquirer = require('enquirer');
var enquirer = new Enquirer();

enquirer.register('password', require('prompt-password'));

// questions can be an array or object
var questions = {
  type: 'password',
  message: 'Enter your password please',
  name: 'password'
};

enquirer.ask(questions)
  .then(function(answers) {
    console.log(answers)
  });
```

## Attribution

Based on the `password` prompt in inquirer.

## About

### Related projects

* [enquirer](https://www.npmjs.com/package/enquirer): Intuitive, plugin-based prompt system for node.js. | [homepage](http://enquirer.io "Intuitive, plugin-based prompt system for node.js.")
* [prompt-base](https://www.npmjs.com/package/prompt-base): Base prompt module used for creating custom prompts. | [homepage](https://github.com/enquirer/prompt-base "Base prompt module used for creating custom prompts.")
* [prompt-question](https://www.npmjs.com/package/prompt-question): Question object, used by Enquirer and prompt plugins. | [homepage](https://github.com/enquirer/prompt-question "Question object, used by Enquirer and prompt plugins.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 05, 2017._

---
_Source: https://npm.io/package/prompt-password · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
