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

picoqr

v0.1.1

Published

Ultra-lightweight zero-dependency QR code generator

Readme

picoqr

Ultra-lightweight, zero-dependency QR code generator for Node.js.

6.6 kB published (tarball) — built to embed into size-sensitive environments where every kilobyte counts.

Use Cases

  • CLI tools — add QR output without inflating your dependency tree
  • Thermal/receipt printers — BMP pixel data maps directly to ESC/POS raster commands, no image conversion needed
  • Serverless functions — zero deps means near-zero cold start overhead
  • Docker Alpine — pure JS, no native bindings, no node-gyp build step
  • IoT / ARM devices — no cross-compilation issues

Why BMP?

Most QR libraries depend on canvas, libpng, or sharp for image output. These bring native bindings, platform-specific binaries, and painful installs on constrained environments.

BMP is an uncompressed bitmap format — encoding it is just raw pixel math. This is what keeps picoqr at zero dependencies. And for thermal printers (ESC/POS), raw bitmap is the native input format, making BMP the shortest path from QR matrix to printed output.

If you need SVG or PNG, use generate() to get the raw boolean matrix and render it yourself.

Install

npm install picoqr

API

generate(text, options?)

Returns a QR code as a 2D boolean matrix (true = dark module).

import { generate } from 'picoqr';

const matrix = generate('https://example.com');
// matrix[row][col] === true means dark module

toBuffer(text, options?)

Returns a QR code as a BMP image Buffer.

import { toBuffer } from 'picoqr';

const bmp = toBuffer('https://example.com', { scale: 8, margin: 2 });

toFile(text, filePath, options?)

Writes a QR code BMP image to disk.

import { toFile } from 'picoqr';

await toFile('https://example.com', 'qr.bmp', { ecLevel: 'M' });

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | ecLevel | 'L' \| 'M' \| 'Q' \| 'H' | 'L' | Error correction level | | scale | number | 10 | Pixels per QR module | | margin | number | 4 | Quiet zone width in modules |

CLI

npx picoqr "https://example.com" -o code.bmp
Usage: picoqr <text> [options]

Options:
  -o, --output <file>   Output BMP file path (default: qr.bmp)
  --scale <n>           Pixel scale per module (default: 10)
  --margin <n>          Quiet zone modules (default: 4)
  --ec <L|M|Q|H>        Error correction level (default: L)
  -h, --help            Show this help

Size Comparison

| Package | Deps | Install size | |---------|------|-------------| | qrcode | 41 | ~135 kB | | @paulmillr/qr | 0 | ~35 kB | | picoqr | 0 | ~6.6 kB |

QR Versions

Supports versions 1–15, covering up to 523 characters (EC level L). Handles URLs, WiFi configs, contact cards, and most real-world payloads.

Requirements

Node.js >= 20.0.0 (ESM only — no CommonJS require() support)

License

MIT