npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nothing-qrcpp

v1.0.0

Published

nothing-browser plugin — typed event wrapper and control API for the C++ PiggyQRDetector built into the Nothing Browser binary

Readme

nothing-qrcpp

Typed event callbacks and manual control API for the C++ QR detector built into the Nothing Browser binary (PiggyQRDetector).

The detector runs automatically — you do not need this package to receive QR events. It exists for discoverability, typed callbacks, and the site.qr control API.


Install

npm install nothing-qrcpp

Usage

const piggy  = require('nothing-browser').default;
const qrcpp  = require('nothing-qrcpp');
const fs     = require('fs');

await piggy.launch({ mode: 'tab', binary: 'headless' });
await piggy.register('whatsapp', 'https://web.whatsapp.com', { single: true });

await piggy.extend(
  qrcpp({
    onQR:      (d) => console.log(`Scan this QR (attempt ${d.attempts}):`, d.qrData),
    onScanned: ()  => console.log('Authenticated!'),
    onTimeout: ()  => console.log('QR rotated — new one incoming...'),
  })
);

await piggy.whatsapp.navigate();

Without this package

If you don't want the dependency, you can listen directly — the C++ emits these events regardless:

piggy.whatsapp.on('qr',         (d) => console.log('Scan:', d.qrData));
piggy.whatsapp.on('qr:scanned', ()  => console.log('Done!'));
piggy.whatsapp.on('qr:timeout', ()  => console.log('Rotated'));

Options

| Option | Type | When called | |---|---|---| | onQR | function | New or rotated QR is ready. data.qrData is "data:image/png;base64,..." | | onScanned | function | QR scanned, WAWeb authenticated | | onTimeout | function | QR expired and rotated (~every 20s) |


Events

| Event | Data | When | |---|---|---| | qr | { tabId, qrData, attempts } | New QR ready — qrData is a base64 PNG data URL | | qr:scanned | { tabId } | Canvas disappeared — auth succeeded | | qr:timeout | { tabId } | QR rotated before being scanned |


API (site.qr)

// Check current QR state
const state = await piggy.whatsapp.qr.status();
// { waiting: true, attempts: 2 }

// Force an immediate canvas check (skips the 500ms poll interval)
await piggy.whatsapp.qr.force();

How the C++ detector works

  • Polls the page every 500ms for a <canvas> matching known WAWeb QR selectors
  • Extracts the canvas as a base64 PNG via canvas.toDataURL()
  • Hashes the image to detect rotation — only emits qr when the image actually changes
  • Prints the QR to the terminal automatically using iTerm2/Kitty inline image protocol with a plain data URL fallback
  • When the canvas disappears, emits qr:scanned and stops polling

Notes

  • To force a fresh QR scan: call site.storage.clear() before navigating (requires nothing-innerstorage)
  • This plugin was made upon request — report any issues found
  • This plugin is tailored specifically for WhatsApp sessions. You can use it on other sites but there is no guarantee it will work, and that is not a bug. A general-purpose nothing-storage plugin will be released in the future to solve that
  • qrData is a data:image/png;base64,... URL — render it in a browser, pass it to a QR library, or display it in the terminal. The C++ already prints it automatically
  • The QR is canvas-based in WAWeb — there is no <img> tag. Do not try to read it with find.css() or provide.text()