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

@parselo/capacitor-mrz

v0.2.0

Published

Native MRZ text recognition (Apple Vision / Android ML Kit) for Capacitor. Returns recognised lines; scanner-core locates and parses the MRZ.

Readme

@parselo/capacitor-mrz

Capacitor plugin for on-device MRZ (Machine Readable Zone) text recognition. Wraps Apple Vision (VNRecognizeTextRequest) on iOS and ML Kit Text Recognition on Android. Returns the recognised text lines; pair with @parselo/scanner-core to locate, parse, and validate the ICAO 9303 MRZ.

Supports all ICAO TD3 travel document types: standard passports (P<), emergency travel documents (PU), permanent resident travel documents (PR), and foreign passports.

Platform support

| Platform | Backend | Min version | |---|---|---| | iOS | Vision — VNRecognizeTextRequest, .accurate level | iOS 13 | | Android | ML Kit Text Recognition v2, Latin script | API 21 |

Language correction is disabled on both platforms — it would corrupt MRZ tokens and check digits.

Install

npm install @parselo/capacitor-mrz @parselo/scanner-core
npx cap sync

iOS — camera permission

Add to ios/App/App/Info.plist (if not already present):

<key>NSCameraUsageDescription</key>
<string>Used to scan the MRZ on your travel document.</string>

CocoaPods installs the MrzPlugin.m ObjC bridge automatically. If the plugin throws "not implemented" at runtime, verify that pod install ran after cap sync and that MrzPlugin.m is listed in the Xcode target's Compile Sources.

Android

No extra configuration needed — the ML Kit dependency is declared in the plugin's build.gradle.

API

import { Mrz } from "@parselo/capacitor-mrz";

const { lines, raw } = await Mrz.recognizeText({ image });
// lines: string[]  — one element per Vision/ML Kit text observation
// raw:   string    — lines joined with "\n"

image accepts a data: URI, file:// URI, bare absolute path, or raw base64 string.

Pass the full camera frame — the plugin sends the entire image to the OCR engine. scanner-core locates the two 44-char MRZ lines anywhere in the returned array and handles OCR noise in the surrounding biographical text.

Integration with scanner-core

import { Scanner } from "@parselo/scanner-core";
import { Mrz }     from "@parselo/capacitor-mrz";

const scanner = new Scanner({
  license: {
    token:      "…",
    bundleId:   "com.example.app",
    publicKeys: { "<kid>": "<base64-spki>" },
  },
  analytics: {
    ingestUrl: "…",
    store: { get, set },
  },
  native:    { captureAndDecodePdf417: … },  // still needed for barcode scanning
  mrzNative: {
    captureAndRecognizeMrz: async () => {
      const { lines } = await Mrz.recognizeText({ image: dataUrl });
      return lines;
    },
  },
});

await scanner.init();
const result = await scanner.scanPassport();
// result.document.documentType === "passport"
// result.document.fields.firstName.value, .dateOfBirth.value, .country.value, …

How name extraction works

OCR-B MRZ uses < as a word separator, which Vision and ML Kit frequently misread as C, S, K, @, etc. scanner-core automatically cross-references Vision's biographical-zone lines (the human-readable area above the MRZ, read in a standard font) to recover correct first and last names even when the MRZ separator characters are corrupted.

See the full integration guide for a complete setup walkthrough including the camera UI component.

License

MIT