2.1.6 • Published 10 days ago

@inquirer/password v2.1.6

Weekly downloads
3
License
MIT
Repository
github
Last release
10 days ago

@inquirer/password

Interactive password input component for command line interfaces. Supports input validation and masked or transparent modes.

Password prompt

Installation

npm install @inquirer/password

yarn add @inquirer/password

Usage

import password from '@inquirer/password';

const answer = await password({ message: 'Enter your name' });

Options

PropertyTypeRequiredDescription
messagestringyesThe question to ask
maskbooleannoShow a * mask over the input or keep it transparent
validatestring => boolean \| string \| Promise<string \| boolean>noOn submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.
themeSee ThemingnoCustomize look of the prompt.

Theming

You can theme a prompt by passing a theme object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.

type Theme = {
  prefix: string;
  spinner: {
    interval: number;
    frames: string[];
  };
  style: {
    answer: (text: string) => string;
    message: (text: string) => string;
    error: (text: string) => string;
    help: (text: string) => string;
  };
};

License

Copyright (c) 2023 Simon Boudrias (twitter: @vaxilart) Licensed under the MIT license.

2.1.6

10 days ago

2.1.5

20 days ago

2.1.4

24 days ago

2.1.3

24 days ago

2.1.2

1 month ago

2.1.1

1 month ago

2.1.0

2 months ago

2.0.2

2 months ago

2.0.1

2 months ago

2.0.0

3 months ago

1.1.16

3 months ago

1.1.15

3 months ago

1.1.9

8 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.12

7 months ago

1.1.11

8 months ago

1.1.10

8 months ago

1.1.14

6 months ago

1.1.13

7 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.0.2

1 year ago

1.1.0

11 months ago

1.0.1

1 year ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.4

12 months ago

1.0.3

1 year ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.0

1 year ago

0.1.0

1 year ago

0.0.27-alpha.0

2 years ago

0.0.28-alpha.0

2 years ago

0.0.25-alpha.0

2 years ago

0.0.21-alpha.0

2 years ago

0.0.22-alpha.0

2 years ago

0.0.23-alpha.0

2 years ago

0.0.20-alpha.0

2 years ago

0.0.19-alpha.0

2 years ago

0.0.18-alpha.0

2 years ago

0.0.17-alpha.0

2 years ago

0.0.16-alpha.0

3 years ago

0.0.15-alpha.0

3 years ago

0.0.14-alpha.0

3 years ago

0.0.13-alpha.0

3 years ago

0.0.12-alpha.0

4 years ago

0.0.11-alpha.0

4 years ago

0.0.10-alpha.0

4 years ago

0.0.9-alpha.0

4 years ago

0.0.8-alpha.0

4 years ago

0.0.6-alpha.0

5 years ago

0.0.5-alpha.0

5 years ago

0.0.4-alpha.0

5 years ago