qrp
v1.0.0
Published
QR Paste - Extract URLs and IPs from text and display as QR codes
Maintainers
Readme
QRP (QR Paste)
A command-line tool that extracts URLs and IPv4 addresses from text and displays them as ASCII QR codes in your terminal.
Features
- 🔍 Automatically extracts URLs (http://, https://, www.) and IPv4 addresses
- 📱 Displays QR codes as ASCII art directly in the terminal
- ⚡ Supports both interactive input and piped/stdin input
- 🎯 Shows multiple QR codes side-by-side, wrapping to new rows as needed
- 📦 Zero dependencies - fully bundled for npx usage
- 🚀 Fast and lightweight
Quick Start (npx)
The easiest way to use qrp is with npx (no installation required):
echo "https://example.com 192.168.1.1" | npx qrpInstallation
Option 1: Use with npx (recommended)
No installation needed! Just use npx qrp whenever you need it.
Option 2: Install globally from npm
npm install -g qrpThen use it anywhere:
qrpOption 3: Install from source
Clone or download this repository
Install dependencies:
npm installBuild the application:
npm run buildLink the command globally (makes
qrpavailable system-wide):npm link
Usage
Interactive Mode
Simply run the command and paste your text:
npx qrpThen paste your text (or type it) and the tool will automatically detect when you're done pasting and display the QR codes.
If you installed globally, you can use
qrpinstead ofnpx qrp
Piped Input
Pipe text directly into the command:
echo "Check out https://example.com and connect to 192.168.1.1" | npx qrpcat logfile.txt | npx qrpcurl https://api.example.com/data | npx qrpExamples
Extract URLs from command output:
docker ps | npx qrpExtract IPs from network diagnostics:
ifconfig | npx qrpProcess clipboard content (macOS):
pbpaste | npx qrpProcess clipboard content (Linux with xclip):
xclip -o | npx qrpProcess clipboard content (Windows PowerShell):
Get-Clipboard | npx qrpNote: If you installed
qrpglobally, replacenpx qrpwith justqrpin all examples above.
What Gets Extracted
- URLs: Any text matching
http://,https://, orwww.patterns - IPv4 Addresses: Valid IPv4 addresses (e.g., 192.168.1.1, 10.0.0.1)
Duplicates are automatically removed from the output.
Output Format
The tool displays:
- Each URL/IP address as a label (colored for easy identification)
- QR codes as ASCII art below each label
- Multiple QR codes are displayed side-by-side when they fit
- QR codes automatically wrap to new rows if your terminal is too narrow
- Each QR code gets a consistent color based on its content
Development
Build
npm run buildDev Mode
npm run devProject Structure
qrp/
├── src/
│ └── index.ts # Main CLI application
├── dist/ # Built output (generated)
├── build.js # esbuild configuration
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This fileRequirements
- Node.js 18 or higher (automatically checked by npx)
- Terminal with Unicode support for best QR code display
- No additional dependencies required (everything is bundled)
License
MIT
Tips
- For best results, use a terminal with good Unicode character support
- Scan the QR codes with your mobile device's camera or QR code reader app
- The tool automatically detects your terminal width and wraps QR codes as needed
- If displaying many QR codes, maximize your terminal window for best results
- If QR codes don't display correctly, try adjusting your terminal's font size
- Each QR code gets a unique color for easy visual distinction
Publishing to npm
If you want to publish this package yourself:
- Update the
nameinpackage.jsonto something unique - Update the
authorfield inpackage.json - Login to npm:
npm login - Publish:
npm publish
The package is configured to automatically bundle all dependencies, so users can run it instantly with npx!
