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

@luciaocr/core

v1.0.0

Published

Shared OCR parsers, validators, formatters, and error models for luciaocr.

Downloads

24

Readme

@luciaocr/core

English

@luciaocr/coreluciaocr 的纯逻辑核心层,负责 OCR 结果解析、字段提取、规则校验、格式化和统一错误模型。它不依赖 DOM、浏览器、iframe、WebView 或 React,适合在 Node 脚本、服务端后处理、测试环境和其他宿主 SDK 中复用。

能力概览

  • 解析 generalidCard-CNbankCarddriverLicense-CN
  • 提取手机号、邮箱、日期、数字、关键词等信息
  • 校验身份证、银行卡、驾驶证相关字段
  • 提供统一错误类型 OCRError

安装

npm install @luciaocr/core

示例

import {
  parseIdCard,
  parseBankCard,
  parseDriverLicenseAuto,
  validateIdCard,
} from "@luciaocr/core";

const idCard = parseIdCard(text, lines);
const bankCard = parseBankCard(text);
const driverLicense = parseDriverLicenseAuto(text, lines);

console.log(idCard, bankCard, driverLicense);
console.log(validateIdCard(idCard.idNumber));

主要导出

  • 解析器:parseGeneralparseIdCardparseIdCardFrontparseIdCardBackparseBankCardparseDriverLicenseAuto
  • 检测器:detectIdCardSidedetectDriverLicensePage
  • 提取器:extractNumbersFromTextextractDatesFromTextextractEmailsFromTextextractPhonesFromText
  • 校验器:validateIdCardvalidateBankCardvalidateBankCardExpiryvalidateDriverLicenseNumber
  • 工具:formatIdCardformatBankCardformatOCRResult

适用场景

  • 仅做 OCR 后处理,不直接接识别引擎
  • 对身份证 OCR 结果做结构化提取与校验
  • 对银行卡 OCR 结果做卡号和有效期检查
  • 对驾驶证 OCR 结果做字段标准化和规则校验

License

MIT