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

@cflorioluis/barcodereader

v0.1.0

Published

Dependency-free 1D/2D barcode & QR decoder. One Rust core, WASM for web (Angular/React/Vue/Electron/Capacitor), native FFI later.

Readme

BarCodeReader

A dependency-free 1D/2D barcode & QR decoder with one core that runs everywhere JavaScript runs — and, later, everywhere native FFI reaches.

The idea

The decoding logic is written once in pure Rust (core/). It knows nothing about cameras, files or platforms: it takes a grayscale pixel buffer and returns the decoded symbols. Every platform is a thin binding on top:

core (Rust, pure, no I/O)
  decode_luma(pixels, width, height) -> Vec<Symbol>
        │
        ├── wasm/   → wasm-pack → npm → Angular, React, Vue, Electron, Capacitor   ← we are here
        ├── ffi/    → .so/.dll/.dylib (C ABI) → Flutter (dart:ffi), PHP (FFI), Python   (step 2)
        └── uniffi  → Swift + Kotlin → native iOS / Android                              (step 3)

Each platform only supplies pixels its own way (getUserMedia on web, AVFoundation on iOS, CameraX on Android). The hard part — finder patterns, perspective sampling, Reed-Solomon, payload decoding — lives in the core and is tested once.

Layout

| Path | What it is | |------|-----------| | core/ | Pure-Rust decoder. Image handling, binarization, QR pipeline. | | wasm/ | wasm-bindgen wrappers → npm package (via wasm-pack). | | js/ | Framework-agnostic camera glue + high-level BarcodeScanner. | | docs/ | Integration guides (Angular, React, Capacitor, WASM bundling). | | demo/ | Runnable apps: React, Angular, Capacitor (+ examples/web). | | examples/web/ | Minimal browser demo driving the camera, zero build. | | ROADMAP.md | Staged build plan and current status of each pipeline stage. |

Status

QR decoding works end-to-end from camera/image pixels: binarization (adaptive + Otsu), finder detection, affine + perspective sampling, format info, Reed-Solomon, and payload decode (numeric / alphanumeric / byte / ECI). Verified against generated QR codes across versions 1–27, all EC levels, and a real photographed thermal-receipt fixture. 1D symbologies and native FFI bindings are next — see ROADMAP.md.

New here? Start with docs/getting-started.md.

Build (once the Rust toolchain is installed)

# 1. Toolchain (one-time)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install wasm-pack

# 2. Run core tests
cargo test -p barcode-core

# 3. Build the npm/WASM package
wasm-pack build wasm --target web --out-dir pkg
# → wasm/pkg/ is a ready-to-import ES module + .wasm

Then import from any framework:

import { BarcodeScanner } from "@cflorioluis/barcodereader";

const scanner = new BarcodeScanner();
await scanner.start((r) => console.log(r.format, r.text)); // call from a click

Platform notes

  • iOS Safari: HTTPS (or localhost) + a user gesture to start. playsinline is set on the video element (required).
  • Android Chrome / desktop: works out of the box on HTTPS/localhost.
  • Capacitor: runs in the WebView using the same WASM path.
  • Electron: same WASM path (Chromium runtime).