A simple Node.js application that generates QR codes from URLs using command-line interface.
- Interactive command-line interface using inquirer
- Generates QR codes in PNG format
- Saves the input URL to a text file for reference
- Built with ES6 modules
- Node.js (version 12 or higher)
- npm (Node Package Manager)
-
Clone this repository:
git clone https://github.com/KrishnaNaicker/QR_code_generator.git cd QR_code_generator -
Install dependencies:
npm install
Run the application:
node index.jsThe application will:
- Prompt you to enter a URL
- Generate a QR code image (
qr_img.png) - Save the entered URL to a text file (
URL.txt)
- inquirer: ^9.3.7 - Interactive command-line user interface
- qr-image: ^3.2.0 - QR code image generator
- fs: ^0.0.1-security - File system operations (Node.js native module)
QR_code_generator/
├── index.js # Main application file
├── package.json # Project dependencies and metadata
├── package-lock.json # Dependency lock file
├── README.md # Project documentation
├── .gitignore # Git ignore rules
├── qr_img.png # Generated QR code image (created after running)
├── qr_img.svg # SVG version of QR code (if generated)
└── URL.txt # Saved URL text file (created after running)
- The application uses the
inquirerpackage to create an interactive prompt - User enters a URL when prompted
- The
qr-imagepackage converts the URL into a QR code - The QR code is saved as
qr_img.png - The original URL is saved to
URL.txtusing Node.jsfsmodule
$ node index.js
? Enter the URL to generate a QR code: https://www.example.com
The file has been saved!After running, you'll find:
qr_img.png- QR code imageURL.txt- Text file containing the URL
ISC
Krishna Naicker
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
If you encounter any issues or have questions, please open an issue on GitHub.