Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code Generator

A simple Node.js application that generates QR codes from URLs using command-line interface.

Features

  • 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

Prerequisites

  • Node.js (version 12 or higher)
  • npm (Node Package Manager)

Installation

  1. Clone this repository:

    git clone https://github.com/KrishnaNaicker/QR_code_generator.git
    cd QR_code_generator
  2. Install dependencies:

    npm install

Usage

Run the application:

node index.js

The application will:

  1. Prompt you to enter a URL
  2. Generate a QR code image (qr_img.png)
  3. Save the entered URL to a text file (URL.txt)

Dependencies

  • 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)

Project Structure

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)

How It Works

  1. The application uses the inquirer package to create an interactive prompt
  2. User enters a URL when prompted
  3. The qr-image package converts the URL into a QR code
  4. The QR code is saved as qr_img.png
  5. The original URL is saved to URL.txt using Node.js fs module

Example

$ 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 image
  • URL.txt - Text file containing the URL

License

ISC

Author

Krishna Naicker

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Support

If you encounter any issues or have questions, please open an issue on GitHub.

About

Simple to use. Can be accessed using CLI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages