@ladabees/qr-cli
v1.0.5
Published
A command-line tool for generating QR codes
Maintainers
Readme
LadaQR CLI
A command-line tool for generating QR codes. This tool combines Node.js and Python to provide a simple yet powerful QR code generation utility.
Prerequisites
- Node.js (>= 12.0.0)
- Python 3.x
- pip (Python package installer)
Installation
Install the package globally using npm:
npm install -g @ladabees/qr-cliThe installation process will automatically install the required Python dependencies.
Usage
Once installed, you can use the ladaqr command from anywhere in your terminal:
ladaqr <data> [output_file] [size]Parameters:
<data>: The data to encode in the QR code (URL, text, etc.)[output_file]: (Optional) The output file name (default: output.png)[size]: (Optional) The size of the QR code in pixels (default: 300)
Examples
- Generate a QR code for a URL:
ladaqr "https://example.com"- Generate a QR code with a custom filename:
ladaqr "Hello World" hello.png- Generate a QR code with custom size:
ladaqr "Hello World" qr.png 500Features
- Simple command-line interface
- Customizable QR code size
- High-quality QR code generation using Python's qrcode library
- Cross-platform support (Windows, macOS, Linux)
Troubleshooting
If you encounter any issues with Python dependencies, you can manually install them:
pip install qrcode[pil]License
ISC
Author
Ladabees
- To generate a QR code for a URL and save it as `my_qr_code.png` with a size of `400`:
```bash
./qr-cli.sh "https://example.com" "my_qr_code.png" 400To generate a QR code for a simple text and save it as
text_qr.pngwith a size of200:./qr-cli.sh "Hello, World!" "text_qr.png" 200
Dependencies
- Python 3: The script requires Python 3 to execute the Python script (
main.py). - qrcode library: The script uses the
qrcodelibrary to generate QR codes.
The script will automatically install the required qrcode library if it is not already installed.
To manually install the qrcode library, run:
pip install qrcode[pil]License
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to contribute to the project by opening issues or pull requests.
Deployment
Follow these steps to deploy and publish the package to npm:
Prerequisites
Ensure you have an npm account
# Login to your npm account npm loginVerify the package contents
- Check package.json for correct:
- name (@ladabees/qr-cli)
- version
- description
- dependencies
- bin configuration
- Ensure all required files are listed in the "files" field
- Check package.json for correct:
Pre-deployment Checks
Run tests if available
npm testVerify the package works locally
# Install dependencies npm install # Create a test QR code node index.js "test" test.png
Publishing
Update version (if needed)
npm version patch # For bug fixes npm version minor # For new features npm version major # For breaking changesPublish the package
npm publish --access publicVerify deployment
# Install the published package globally npm install -g @ladabees/qr-cli # Test the installed package ladaqr "test" verification.png
Post-deployment
Tag the release in git
git tag v1.0.0 # Replace with your version git push origin v1.0.0Update documentation if needed
Troubleshooting
If you encounter publishing issues:
Ensure you're logged in to npm
npm whoamiCheck if the package name is available
npm search @ladabees/qr-cliVerify your npm account has necessary permissions
