@vaibhavjha/qrfy
v1.1.0
Published
Scan your dev server instantly - QR code for local dev URLs
Maintainers
Readme
QRfy
Your dev server, on your phone, in seconds. Stop typing IPs. Start scanning.
Why?
You start a dev server. You want to test on your phone. Now you're squinting at
ifconfigoutput and fat-fingering192.168.1.47:3000into a tiny mobile browser. Again.
QRfy fixes this in one line.
Quick Start
# Install as a dev dependency
npm install -D @vaibhavjha/qrfy
# Run with your dev server
npx qrfy next devThat's it. A QR code appears in your terminal. Scan it. Done.
Demo
$ qrfy next dev
> next dev
> ready - started server on 0.0.0.0:3000
-----------------------------------------------
QRfy connected
Local: http://localhost:3000
Mobile: http://192.168.1.5:3000
Scan to open on your phone:
[QR CODE]
Ensure both devices are on the same WiFi
-----------------------------------------------Install
# As a dev dependency
npm install -D @vaibhavjha/qrfyyarn add -D @vaibhavjha/qrfy
pnpm add -D @vaibhavjha/qrfy
bun add -d @vaibhavjha/qrfynpm install -g @vaibhavjha/qrfy
yarn global add @vaibhavjha/qrfy
pnpm add -g @vaibhavjha/qrfy
bun add -g @vaibhavjha/qrfyUsage
qrfy <your-dev-command>Works With Everything
| | Framework | Command |
|---|-----------|---------|
| Next.js | React framework | qrfy next dev |
| Vite | Lightning fast | qrfy vite |
| CRA | Create React App | qrfy react-scripts start |
| Remix | Full stack React | qrfy remix dev |
| Astro | Content-focused | qrfy astro dev |
| SvelteKit | Svelte framework | qrfy svelte-kit dev |
| npm scripts | Any project | qrfy npm run dev |
| Python | http.server | qrfy python -m http.server 8000 |
| Go | Any server | qrfy go run main.go |
Basically anything that prints a URL or port to the terminal.
Drop it in package.json
{
"scripts": {
"dev": "qrfy next dev"
}
}Now npm run dev gives you a QR code every time. Your whole team gets it for free.
Share From Anywhere (Cloudflare Tunnel)
Same WiFi not an option? Pass -t (or --tunnel) and QRfy will expose your dev server through a free Cloudflare quick tunnel — a fresh *.trycloudflare.com URL, reachable over cellular, from a coworker's laptop, or a stakeholder on the other side of the world.
qrfy -t next dev
qrfy --tunnel npm run devYou'll get a QR for the public URL instead of the LAN one. No Cloudflare account needed.
One-time setup — install cloudflared:
# macOS
brew install cloudflared
# Windows
winget install --id Cloudflare.cloudflared
# Linux
# https://pkg.cloudflare.com/index.htmlThe tunnel URL is fresh every run and tears down when you Ctrl+C. Don't share it for anything you wouldn't put on the open internet.
QR for Anything
Need a QR code for a URL, a WiFi password, or any piece of text? Use -q:
qrfy -q https://example.com
qrfy -q "hello world"
qrfy -q "WIFI:T:WPA;S:MyNetwork;P:mypassword;;"No dev server, no port detection — just a scannable QR code in your terminal.
CLI Options
qrfy <command> # Wrap a dev server
qrfy -t <command> # Wrap + expose via Cloudflare tunnel
qrfy -q <text|url...> # QR code for any text or URL
qrfy --help, -h # Show help
qrfy --version, -v # Show versionHow It Works
+------------------+
| qrfy next dev | You run your command
+--------+---------+
|
v
+------------------+
| Spawn process | QRfy runs it as a child process
+--------+---------+
|
v
+------------------+
| Watch stdout | Detects port from server output
+--------+---------+
|
v
+------------------+
| Get LAN IP | Finds your local network address
+--------+---------+
|
v
+------------------+
| Print QR code | Generates scannable QR in terminal
+------------------+- All stdout/stderr from your server passes through untouched
- QR renders once — no spam
- Ctrl+C stops both QRfy and your server cleanly
Requirements
| | Requirement |
|---|---|
| Runtime | Node.js >= 14 |
| Network | Same WiFi (or cloudflared installed for -t) |
| OS | macOS, Linux, Windows |
Troubleshooting
The port wasn't detected from your server's output. Make sure your dev server prints a URL like http://localhost:3000 to stdout or stderr.
- Ensure both devices are on the same WiFi network
- Check if your firewall is blocking the port
- Some public/corporate WiFi networks isolate devices
Tunnel mode shells out to Cloudflare's cloudflared binary. Install it with the command for your OS shown in the Share From Anywhere section, then retry.
Make sure your global npm bin is in your PATH:
npm config get prefix
# Add <prefix>/bin to your PATH if neededContributing
PRs welcome! This is a simple tool — keep it that way.
git clone https://github.com/vaibhavjha-dev/qrfy.git
cd qrfy
npm link # Makes 'qrfy' available globally from local codeLicense
Made by Vaibhav Jha
