Skip to content
CAI
Software that uses CAICheck a score

naptha/tesseract.js

62.9

Adequate · 25 September 2026

2k

lines of production code

JavaScript

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added browser benchmarks for auto-rotate and speed/memory profiling

New HTML benchmark files have been added to the benchmarks/browser directory. The auto-rotate benchmark tests image rotation and recognition workflows, while the speed benchmark measures recognition performance and tracks worker memory utilization using the browser's performance API.

benchmarks/browser · high confidence

Added build and development scripts for ESM and production bundles

The scripts directory now includes configuration files for building the library. A new Rollup configuration generates an ES Module (ESM) bundle with source maps, while Webpack configurations handle production builds for UMD and worker scripts, including Babel transpilation for browser compatibility. Additionally, a development server script and test helper utilities have been added to support the build and testing workflows.

scripts · high confidence

Added memory and speed benchmarks for Node.js

Added new memory and speed benchmark scripts for the Node.js environment. The memory benchmark measures heap usage, RSS, and external memory across multiple iterations, while the speed benchmark measures processing time for image recognition tasks. These tools allow users to evaluate performance characteristics of the library in Node.js.

benchmarks/node · high confidence

Introduce environment detection and path resolution utilities

Added new utility modules in src/utils to improve environment detection and path handling. getEnvironment.js now detects whether the code is running in a web worker, browser, or Node.js environment. resolvePaths.js provides a browser-aware URL resolution for core, worker, and language paths, ensuring correct behavior in browser contexts. Additionally, getId.js generates unique IDs, and log.js provides a simple logging mechanism.

src/utils · high confidence

New Node.js examples for PDF generation, image processing, and parallel scheduling

Added four new Node.js example scripts: \download-pdf.js\ demonstrates generating PDF output from OCR; \image-processing.js\ shows how to retrieve and save intermediate image formats (color, grayscale, binary); \recognize.js\ provides a basic text recognition example; and \scheduler.js\ illustrates using a worker scheduler to process multiple images in parallel. All examples use the \createWorker\ and \createScheduler\ APIs.

examples/node · high confidence

New browser examples for efficient processing, scheduling, PDF export, and image preprocessing

Four new HTML examples have been added to the browser demo directory. basic-efficient.html demonstrates single-worker usage with a custom core path; basic-scheduler.html shows how to manage a pool of workers for parallel processing of multiple files; download-pdf.html illustrates how to generate and download a PDF from recognized text; and image-processing.html displays original, grayscale, and binary image outputs alongside the text. These examples showcase the library's capabilities in a browser environment.

examples/browser · high confidence

Architecture

Project infrastructure and configuration updates

The repository received a suite of new configuration files to standardize development and build processes. An ESLint configuration (.eslintrc) was added to enforce code style using the airbnb-base rules and @babel/eslint-parser. A Babel configuration (babel.config.json) was introduced to target the last two versions of major browsers. The test runner was configured via a new karma.conf.js file to execute tests in Chrome and Firefox headless browsers. Additionally, .gitignore was updated to exclude build artifacts and test data, .npmignore was added to prevent publishing unnecessary files to npm, and .gitpod.yml/.gitpod.Dockerfile were added to support Gitpod cloud development environments.

(repo-wide) · high confidence

Behavioural changes

Node worker script refactored with automatic SIMD detection and caching

The Node.js worker script has been restructured into modular components (cache, core loading, gunzip) and now automatically detects WebAssembly SIMD support to load the most optimized Tesseract.js core variant. A local file cache has been introduced to store and retrieve cached data, and the worker now uses the 'worker\_threads' module for inter-process communication.

src/worker-script/node · medium confidence

Refactor browser worker implementation and update default CDN

The browser worker implementation has been refactored into separate modules (spawn, terminate, message handling, image loading) and now defaults to loading the worker script from jsdelivr instead of unpkg, which may improve availability and performance. The image loading logic has been updated to support OffscreenCanvas, and the worker path is now dynamically constructed using the current package version.

src/worker/browser · high confidence

Refactored Node.js worker implementation with modular components

The Node.js worker implementation has been restructured into separate modules for better maintainability. The core logic is now split into distinct files: defaultOptions, spawnWorker, terminateWorker, onMessage, send, and loadImage. The loadImage function now supports fetching images from URLs (including moz-extension:// and chrome-extension:// schemes) and local files, using the built-in fetch API or node-fetch as a fallback. The spawnWorker function now uses the 'worker\_threads' module to create worker processes.

src/worker/node · medium confidence

Refactored Tesseract.js core into modular components

The core library has been refactored into separate modules for worker creation, job scheduling, and constants (OEM, PSM, image types, languages). The main entry point now exports these components alongside the simplified \recognize\ and \detect\ functions, which now automatically manage worker lifecycle by terminating workers after use. This change introduces a new scheduler-based architecture for handling multiple jobs concurrently.

src · high confidence

Refactored browser worker script into modular components

The browser worker script has been refactored into separate modules for caching, core loading, and gunzip, each exporting specific functionality. The main index.js now imports and registers these modules via the worker adapter, replacing the previous monolithic structure. This change improves code organization and maintainability without altering the external API.

src/worker-script/browser · high confidence

Refactored image processing and output serialization in worker-script utils

The worker-script utility modules were refactored to improve image handling and output generation. The \setImage\ function now explicitly validates BMP files using magic numbers and leverages the \bmp-js\ library to convert BMP images into a format compatible with Leptonica, while also parsing EXIF rotation data. The \dump\ module was rewritten to serialize recognition results into a structured JSON object, utilizing a new \arrayBufferToBase64\ utility for converting image buffers to base64 strings for the \imageColor\, \imageGrey\, and \imageBinary\ outputs. This change consolidates and clarifies how image data is prepared for the OCR engine and how results are exported.

src/worker-script/utils · high confidence

Refactored worker script initialization and language loading

The worker script was refactored to improve initialization and language loading. The code now explicitly handles fetching and caching of .traineddata files, supporting both browser and Node.js environments. It includes logic to check for existing .traineddata files in cache, fetch new ones if necessary, and handle gzip compression. The refactoring also includes updates to progress reporting and error handling during the loading process.

src/worker-script · medium confidence

Test coverage

8 commits adding/updating tests in tests/assets/traineddata; Add unit tests for Tesseract.js core features.

Dependencies

Upgrade to Tesseract.js v7.0.0

The project has been upgraded to version 7.0.0, introducing a new dependency on tesseract.js-core v7.0.0. This update also refreshes the build tooling, including Babel, ESLint, Webpack, and Rollup, to their latest compatible versions.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 43 → 63 (+19.7)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 49 → 60 (+11.7)
  • Architecture 99 (new)
  • Maturity 60 → 56 (-3.5)
  • Readiness 31 → 67 (+36.6)
  • Security 70 → 82 (+11.6)

Resolved (76)

  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Dimension evaluation failed
  • FileTooLong: worker-script/index.js (src/worker-script/index.js)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • …and 56 more

New (76)

  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no licence statement (README.md)
  • Documentation: no usage examples (README.md)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • …and 56 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

naptha/tesseract.js was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 25 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a1ca80d9e31c34512d0ded75ff8821ddcf3f2f91 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-dd72cc24c749.