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

react-native-wayscanner

v0.1.13

Published

Super-sensitive barcode & QR scanner for React Native — Vision Camera + C++ preprocess + MLKit + ZXing fallback

Readme

react-native-wayscanner

Super-sensitive barcode & QR code scanner for React Native.

Pipeline: Vision Camera → Frame Processor → C++ preprocess → MLKit decode → ZXing fallback

100% Gratis — Tanpa Biaya Lisensi

Semua komponen open-source, tidak ada SDK berbayar:

| Komponen | Lisensi | Biaya | |----------|---------|-------| | Vision Camera V5 | MIT | Gratis | | Google MLKit Barcode | Free (bundled ~2.4MB) | Gratis | | zxing-cpp (Android) | MIT | Gratis | | ZXingObjC (iOS) | Apache 2.0 | Gratis | | C++ Preprocessor | MIT | Gratis | | npm publish | Public package | Gratis |

OpenCV opsional (juga gratis) — default memakai preprocessor C++ built-in tanpa dependency tambahan.

Features

  • Multi-pass C++ preprocessing (histogram equalize, adaptive threshold, sharpen)
  • Google MLKit as primary decoder (iOS + Android)
  • ZXing fallback for edge cases
  • Three sensitivity levels: normal | high | ultra
  • Drop-in <WayScanner /> component or headless useWayScanner() hook
  • Built on Vision Camera V5 + Nitro Modules

Installation

npm install react-native-wayscanner \
  react-native-vision-camera \
  react-native-vision-camera-worklets \
  react-native-worklets \
  react-native-nitro-modules \
  react-native-nitro-image

iOS

cd ios && pod install

Add to Info.plist:

<key>NSCameraUsageDescription</key>
<string>Camera is needed to scan barcodes</string>

Android

Add to AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />

Quick Start

import { WayScanner } from 'react-native-wayscanner';

export default function App() {
  return (
    <WayScanner
      isActive={true}
      formats={['qr-code', 'ean-13']}
      sensitivity="ultra"
      onBarcodeScanned={(codes) => {
        console.log('Scanned:', codes[0]?.rawValue);
        console.log('Engine:', codes[0]?.decodeEngine);
        console.log('Pass:', codes[0]?.preprocessPass);
      }}
      style={{ flex: 1 }}
    />
  );
}

Advanced — Frame Processor

import { Camera, useFrameOutput } from 'react-native-vision-camera';
import { useWayScanner } from 'react-native-wayscanner';
import { useRunOnJS } from 'react-native-worklets';

function CustomScanner() {
  const scanner = useWayScanner({
    formats: ['qr-code'],
    sensitivity: 'ultra',
    enableZXingFallback: true,
  });

  const onScan = useRunOnJS((value: string) => console.log(value));

  const frameOutput = useFrameOutput({
    onFrame(frame) {
      'worklet';
      const codes = scanner.scanCodes(frame);
      if (codes.length > 0 && codes[0]?.rawValue) {
        onScan(codes[0].rawValue);
      }
      frame.dispose();
    },
  });

  return (
    <Camera device="back" isActive outputs={[frameOutput]} style={{ flex: 1 }} />
  );
}

API

<WayScanner />

| Prop | Type | Default | Description | |------|------|---------|-------------| | isActive | boolean | — | Enable/disable scanning | | formats | TargetBarcodeFormat[] | — | Barcode types to detect | | sensitivity | 'normal' \| 'high' \| 'ultra' | 'high' | Preprocessing intensity | | enableZXingFallback | boolean | true | Use ZXing when MLKit fails | | enableMultiPass | boolean | true | Enable OpenCV preprocessing | | minConfidence | number | 0.7 | Minimum confidence threshold | | debounceMs | number | 500 | Debounce duplicate scans | | onBarcodeScanned | (codes) => void | — | Scan callback |

Sensitivity Levels

| Level | Passes | Engines | ~Latency | |-------|--------|---------|----------| | normal | Original frame | MLKit | ~10ms | | high | + CLAHE | MLKit | ~20ms | | ultra | + threshold + sharpen + invert | MLKit → ZXing | ~33ms |

Development

npm install --legacy-peer-deps
npm run build
npm run specs

# Setup & run example app (gratis)
npm run example:setup
cd example && npx react-native run-android

Enable OpenCV (optional, recommended for production)

Android — add to android/build.gradle:

implementation 'org.opencv:opencv:4.9.0'

And in android/CMakeLists.txt set WAYSCANNER_USE_OPENCV=ON.

iOS — add to Podfile:

pod 'OpenCV', '~> 4.3'

Architecture

┌─────────────────────────────────────────────────┐
│  React Native (JS)                              │
│  WayScanner / useWayScanner / useFrameOutput    │
└────────────────────┬────────────────────────────┘
                     │ JSI (Nitro)
┌────────────────────▼────────────────────────────┐
│  Native (Kotlin / Swift)                        │
│  HybridWayScanner.scanCodes(frame)              │
└────────────────────┬────────────────────────────┘
                     │
┌────────────────────▼────────────────────────────┐
│  C++ Engine (shared iOS + Android)              │
│  Preprocessor → multi-pass image enhancement    │
└────────────────────┬────────────────────────────┘
                     │
          ┌──────────┴──────────┐
          ▼                     ▼
    ┌──────────┐         ┌──────────┐
    │  MLKit   │         │  ZXing   │
    │ (primary)│         │(fallback)│
    └──────────┘         └──────────┘

License

MIT