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

@wefterjs/scanner

v0.0.1

Published

Official Wefter plugin for high-performance camera QR code & barcode scanning on Android & iOS.

Readme

@wefterjs/scanner

Official Wefter plugin for high-performance camera QR code & barcode scanning on Android & iOS.


Features

  • 📷 Real-Time Camera Frame Processing: Uses Google MLKit Barcode Scanning (Android) & AVFoundation AVCaptureMetadataOutput (iOS).
  • 🏷️ Multi-Format Support: QR Code, EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, ITF, Aztec, PDF417, Data Matrix.
  • 🔦 Torch & Camera Control: Programmatically toggle torch and switch front/back cameras.
  • 📡 Event Streams: Real-time barcode scan callbacks (scanner:codeScanned).

Installation & Setup

  1. Add the plugin to your Wefter project:
wefter add @wefterjs/scanner
  1. Synchronize native projects:
wefter sync

Native Permissions Configuration

  • Android: Automatically requests <uses-permission android:name="android.permission.CAMERA" /> and <uses-permission android:name="android.permission.VIBRATE" />.
  • iOS (Info.plist): Automatically injects NSCameraUsageDescription ("Used to scan barcodes and QR codes.").

JavaScript API Reference

Import invokeNative and registerHook from @wefterjs/core:

import { invokeNative, registerHook } from "@wefterjs/core";

1. scan(options)

Launches the camera barcode scanner overlay.

interface ScanOptions {
  formats?: string[]; // Allowed formats: ["QR_CODE", "EAN_13", "CODE_128"] (default: all)
  torch?: boolean; // Enable torch automatically (default: false)
  cameraDirection?: "back" | "front"; // Camera sensor (default: "back")
}

await invokeNative("scanner", "scan", {
  formats: ["QR_CODE", "EAN_13"],
  cameraDirection: "back",
});

2. stop()

Stops the active scanner and closes the camera preview overlay.

await invokeNative("scanner", "stop");

Event Subscriptions

Listen to scanned codes via registerHook:

import { registerHook } from "@wefterjs/core";

interface ScannedCodePayload {
  rawValue: string;
  format: string;
}

// Subscribe to scanned code events
const scanSub = registerHook("scanner:codeScanned", (data: ScannedCodePayload) => {
  console.log("Scanned Value:", data.rawValue);
  console.log("Barcode Format:", data.format);
});

// Subscribe to scanner cancelled event
const cancelSub = registerHook("scanner:cancelled", () => {
  console.log("User dismissed scanner overlay");
});

Complete Usage Example

import { invokeNative, registerHook } from "@wefterjs/core";

export async function startQrScan(): Promise<string> {
  return new Promise((resolve, reject) => {
    const codeSub = registerHook("scanner:codeScanned", (data: { rawValue: string }) => {
      codeSub.remove();
      cancelSub.remove();
      invokeNative("scanner", "stop");
      resolve(data.rawValue);
    });

    const cancelSub = registerHook("scanner:cancelled", () => {
      codeSub.remove();
      cancelSub.remove();
      reject(new Error("Scan cancelled"));
    });

    invokeNative("scanner", "scan", { formats: ["QR_CODE"] });
  });
}