https://github.com/commenthol/pwdgen
Generates a random and secure password; With CLI
https://github.com/commenthol/pwdgen
Last synced: 17 days ago
JSON representation
Generates a random and secure password; With CLI
- Host: GitHub
- URL: https://github.com/commenthol/pwdgen
- Owner: commenthol
- License: mit
- Created: 2023-08-06T05:12:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-06T05:22:45.000Z (almost 3 years ago)
- Last Synced: 2025-10-20T00:08:35.379Z (8 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pwdgen
> Generates a random and secure password; With CLI
[![npm-badge][npm-badge]][npm]
![types-badge][types-badge]
## Usage
npm i -g @commenthol/pwdgen
## CLI
pwdgen [options]
Generates a random and secure password.
-h|--help This help text
-l|--length Length of password. Default is 20
-0|--no-digits Do not use digits
-U|--no-upper Do not use uppercase characters
-L|--no-lower Do not use lowercase characters
-S|--no-symbols Do not use symbols
-s|--safe-symbols Use safe symbols
-e|--ext Use extended symbols and characters
-r|--remove-chars Remove chars from allowed chars
-a|--alphabet Use alphabet only
## API
```js
import { generate } from '@commenthol/pwdgen'
const options = { length: 30 }
generate(options)
```
**options**
```ts
export type PwdGenOptions = {
/**
* length of password
*/
length?: number | undefined;
/**
* use digits
*/
digits?: boolean | undefined;
/**
* use uppercase characters
*/
uppercase?: boolean | undefined;
/**
* use lowercase cha
*/
lowercase?: boolean | undefined;
/**
* use safe symbols only
*/
symbolsSafe?: boolean | undefined;
/**
* use symbols
*/
symbols?: boolean | undefined;
/**
* use extended symbols
*/
symbolsExt?: boolean | undefined;
/**
* use extended character set
*/
charsExt?: boolean | undefined;
/**
* exclude characters
*/
excludeChars?: string | undefined;
/**
* provide alphabet of allowed chars
*/
alphabet?: string | undefined;
};
```
## License
MIT License
See [LICENSE][] for more info.
[LICENSE]: ./LICENSE
[npm-badge]: https://badgen.net/npm/v/@commenthol/pwdgen
[npm]: https://www.npmjs.com/package/@commenthol/pwdgen
[types-badge]: https://badgen.net/npm/types/@commenthol/pwdgen