@karibash/password-generator
Version:
A simple password generation helper function.
54 lines (38 loc) • 1.47 kB
Markdown
[](https://github.com/Karibash?tab=followers)
[](https://twitter.com/intent/follow?screen_name=Karibash)
A simple password generation helper function.
The basic usage is as follows:
```typescript
import password from '@karibash/password-generator';
console.log(password(9));
// -> C_Tpmf45L
```
By specifying a character array as the second argument, you can change the characters to be used during generation.
At least one character from each array will be used.
You can change the string to be used when generating by doing the following:
```typescript
import password, { alphabetLowercase, alphabetUppercase } from '@karibash/password-generator';
const charSet = [
alphabetLowercase,
alphabetUppercase,
];
console.log(password(9, charSet));
```
By default, a string containing uppercase and lowercase letters, numbers, and symbols will be generated.
```typescript
const defaultCharSet = [
alphabetLowercase,
alphabetUppercase,
digits,
sign,
];
```
```
$ npm install @karibash/password-generator
```
Contributions, issues and feature requests are welcome.
Feel free to check [issues page](https://github.com/Karibash/password-generator/issues) if you want to contribute.