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

id-scanner-lib

v1.5.0

Published

Browser-based ID card, QR code, and face recognition scanner with liveness detection

Readme

ID-Scanner-Lib

一个强大的浏览器端身份证识别、二维码扫描和人脸识别库,具有活体检测功能。

功能特点

  • 身份证识别: 支持中国居民身份证识别,提取身份信息和照片
  • 二维码扫描: 支持多种二维码和条形码格式,实时视频扫描
  • 人脸识别: 人脸检测、特征点定位、属性分析和活体检测
  • 轻量级: 优化的代码结构,支持按需加载
  • 易于集成: 简洁的API,适用于各种Web应用
  • 跨平台: 支持PC和移动设备,多种浏览器兼容

安装

npm install id-scanner-lib

快速开始

身份证识别

import { IDScanner } from 'id-scanner-lib';

// 创建并初始化扫描器
const scanner = new IDScanner();
await scanner.initialize();

// 获取身份证模块
const idCardModule = scanner.getIDCardModule();

// 识别身份证
const imageElement = document.getElementById('id-card-image');
const result = await idCardModule.recognize(imageElement);

console.log('姓名:', result.name);
console.log('身份证号:', result.idNumber);
console.log('地址:', result.address);

二维码扫描

// 获取二维码模块
const qrCodeModule = scanner.getQRCodeModule();

// 从图像中扫描二维码
const qrImage = document.getElementById('qr-image');
const qrResult = await qrCodeModule.scan(qrImage);

console.log('二维码内容:', qrResult.data);

人脸识别

// 获取人脸模块
const faceModule = scanner.getFaceModule();

// 检测人脸
const faceImage = document.getElementById('face-image');
const faceResult = await faceModule.detectFace(faceImage);

console.log('检测到人脸:', faceResult.boundingBox);
console.log('置信度:', faceResult.confidence);

// 人脸比对
const face1 = document.getElementById('face1');
const face2 = document.getElementById('face2');
const comparison = await faceModule.compareFaces(face1, face2);

console.log('相似度:', comparison.similarity);
console.log('是否匹配:', comparison.isMatch);

文档

完整文档请访问我们的官方文档网站

演示

浏览器兼容性

  • Chrome 60+
  • Firefox 55+
  • Safari 11+
  • Edge 79+
  • Opera 47+
  • iOS Safari 11+
  • Android Chrome 60+

许可证

MIT