URL to QR Code Generator
Generate QR codes from URLs using Node.js.
Quick Start
bash
node /root/clawd/skills/url2qrcode/scripts/generate.js "https://example.com"
Usage
Basic Usage
bash
node scripts/generate.js <url> [output.png]
With Custom Output Path
bash
node scripts/generate.js "https://github.com" my-qrcode.png
Options (Environment Variables)
- •
QR_SIZE- Width in pixels (default: 300) - •
QR_DARK- Dark color hex (default: #000000) - •
QR_LIGHT- Light color hex (default: #ffffff)
Example with custom size:
bash
QR_SIZE=500 node scripts/generate.js "https://example.com" large-qr.png
Output
- •Default output:
qrcode.pngin current directory - •Returns the full path to the generated file
URL Validation
Valid URLs must:
- •Start with
http://,https://, orftp:// - •Not contain spaces
Dependencies
Uses qrcode npm package. Install if needed:
bash
npm install qrcode