A simple Node.js command-line application that generates a QR code from a user-provided URL.
The application uses Inquirer for user input, qr-image for QR code generation, and Node’s fs module for file handling.
- Prompt the user for a URL using Inquirer.
- Generate a QR code (
qr_code.png
) from the entered URL. - Save the original URL to a text file (
URL.txt
). - Demonstrates npm package usage and Node.js file system operations.
-
Clone the repository:
git clone https://github.com/yourusername/qr-code-generator.git cd qr-code-generator
-
Install dependencies:
npm install inquirer qr-image
Run the app in your terminal:
node index.js
Follow the prompt to enter a URL, for example:
? Enter the URL you want to turn into a QR code: https://openai.com
The app will:
- Generate a QR code image named
qr_code.png
. - Save the input URL in a
URL.txt
file.
qr-code-generator/
│── index.js # Main application file
│── package.json # Dependencies and scripts
│── URL.txt # Stores user-entered URL (generated)
│── qr_code.png # Generated QR code image (generated)
│── README.md # Project documentation
(Optional: Add a screenshot of your terminal and generated QR code here)
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.