Command line application that generates passwords.
PassGen is a command-line tool written in Node.js that allows users to generate random passwords based on specified criteria. PassGen provides options for controlling the length of the password and whether to include numbers and symbols. Additionally, it offers the option to save generated passwords to a file.
-
Ensure you have Node.js installed on your machine.
node -v
If not, install Node.js.
-
Clone the repository to your local machine:
git clone https://github.com/khamisilawrence/nodejs-password-generator.git
-
Navigate to repository:
cd nodejs-password-generator
-
Install dependencies:
npm install
To generate a password, use the following command:
passgen -l <length> -s -nn -ns
Replace with the desired password length.
Example:
passgen -l 12 -s
This generates a password of length 12 with symbols and saves it to 'passwords.txt'.
Short | Long | Description |
---|---|---|
-l | --length | Specifies the length of the generated password (default is 8). |
-s | --save | Saves the generated password to 'passwords.txt'. |
-nn | --no-numbers | Excludes numbers from the generated password. |
-ns | --no-symbols | Excludes symbols from the generated password. |
-h | --help | Display help for the command. |
-V | --version | Show the version. |
./utils/createPassword.js
: Module for generating random passwords../utils/savePassword.js
: Module for saving passwords to 'passwords.txt'../index.js
: CLI tool script that utilizes the above modules.
- The 'passwords.txt' file is intended for personal use only and is not encrypted by default. Avoid sharing it publicly or with unauthorized individuals.
- If you require enhanced security, consider implementing encryption or using a dedicated password manager.
Contributions are welcome! Please follow the Contribution Guidelines.
This project is licensed under the MIT License.
- This project was completed as practice following guidance provided by a 30-minute YouTube tutorial uploaded by Traversy Media on the 5th of July 2021, titled “Build a Node.js Password Generator”.
- This project was inspired by Brad Traversy's passgen Github repository.