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

@jg-stevan/scanner-core

v0.4.1

Published

Motor headless de escaneo de documentos: cámara, detección de bordes, procesado, OCR, calidad y exportación. Sin UI. Browser-only (consume vía bundler).

Readme

@jg-stevan/scanner-core

Motor headless de escaneo de documentos en el navegador. Sin UI: tú pones la cámara, el worker y la interfaz; el core pone el motor.

Qué incluye

Detección de bordes en vivo (cliente de worker), frame loop con auto-shutter (puntuador de encuadre + compuerta de quietud por sensor inercial), procesado de imágenes (downscale/warp/filtros/unsharp, HEIC), OCR, exportación PDF/PNG/ texto, gestión de páginas/documentos (zustand), perfilado del sensor y PWA.

Reglas del contrato

  1. Nada de React, Next.js ni imports de UI. Solo TS + zustand (peer) + jspdf.
  2. Los assets (detection-worker.js, OpenCV, service worker) NO viajan en el paquete: viven en el public/ de tu app. El core los localiza vía process.env.NEXT_PUBLIC_BASE_PATH (cualquier bundler define process.env de build; si tu stack no usa ese nombre, define la variable igualmente).
  3. Los exports son aditivos: renombrar o quitar rompe consumidores.

Uso

import { SHUTTER_SCORE } from "@jg-stevan/scanner-core/quality";
import type { Quad, ScanDocument } from "@jg-stevan/scanner-core/types";
import { CameraFrameLoop } from "@jg-stevan/scanner-core/frame-loop";

Requiere bundler (Next.js, Vite, Bun) — no corre en Node directo (usa canvas/navigator/localStorage del navegador, con guards de entorno).

Proyecto vivo: https://github.com/Jg-Stevan/web-scanner (apps de referencia: apps/scanner-lab = consumidor completo de todos los módulos).

Módulos (17)

| Módulo | Responsabilidad | |---|---| | store | Estado global Zustand (documentos, páginas, ajustes, papelera) | | types | Tipos + helpers runtime (isTrashed, trashDaysLeft, …) | | image-processor | Pipeline de imágenes: warp de perspectiva, filtros, escalado | | image-modes | Modos de imagen (B/N adaptativo, escala de grises, …) | | frame-loop | Bucle de cámara con throttling adaptativo | | detector-client | Puente TS ⇄ Web Worker de detección de bordes (OpenCV) | | quality | Score de calidad de captura (SHUTTER_SCORE, 0-10) | | ocr | OCR bajo demanda (local Tesseract / remoto según entorno) | | pdf-export | Exportación PDF adaptativa (jspdf, presupuesto de bytes §8) | | text-export | Exportación TXT / compartir texto OCR | | format | Formateo (bytes, tiempo relativo, …) | | tags | Etiquetas de documentos | | page-store | Persistencia IndexedDB de páginas | | sensor-profiler | Tope de resolución del sensor (F-SENSOR · 4032 px fijo) | | motion-stabilizer | Compuerta de quietud (F-STAB) | | pwa | Registro de Service Worker | | mock-data | Datos de hidratación inicial (interno) |

Assets que tu app debe servir en su public/

scanner/detection-worker.js, vendor/opencv-4.5.5.js, vendor/opencv-4.5.5-core.js, sw.js y manifest.webmanifest — el core los localiza vía process.env.NEXT_PUBLIC_BASE_PATH.