tesseract.js-core is the foundational WebAssembly (WASM) module that powers the higher-level tesseract.js OCR library. It compiles the original Tesseract C++ engine to JavaScript and WASM using Emscripten, enabling Optical Character Recognition directly in browser and Node.js environments. The current stable version is `7.0.0` as of December 2025. This package provides the low-level API for interacting with the Tesseract engine, offering optimized builds like 'Relaxed SIMD' for performance on supported hardware and 'LSTM-only' builds for reduced size when only the modern LSTM OCR engine is needed. It typically releases new major versions to incorporate updates from the upstream Tesseract C++ project and Emscripten. Key differentiators include its pure JavaScript/WASM implementation, enabling client-side OCR, and direct access to Tesseract's core functionality, which is crucial for custom integrations or highly performance-sensitive applications that bypass the abstractions of `tesseract.js`.
npm install tesseract.js-coreVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to load the `tesseract.js-core` WebAssembly module, initialize the Tesseract API, set an image buffer, perform OCR, and retrieve the recognized text using low-level methods. This example simulates a Node.js environment.
Always install `tesseract.js-core` and `tesseract.js` with matching major version numbers. Refer to the `tesseract.js` documentation for compatible core versions.
Update references to the core module to use `TesseractCore` instead of `TesseractCoreWASM`.
If using the 'Relaxed SIMD' build and encountering `WebAssembly.compile()` errors, ensure the target environment supports `wf-wasm-simd-relaxed`. Fall back to the standard SIMD build (`tesseract-core-simd`) or the non-SIMD build (`tesseract-core`) if compatibility issues arise.
If you require the Tesseract Legacy engine, avoid using the `*-lstm` specific builds. Most modern use cases are fine with LSTM-only builds, as LSTM is the default and generally more accurate engine.
Ensure you call the imported factory function and `await` its result: `const TesseractCore = await TesseractCoreInit();`
Verify the exact path for the desired build variant (e.g., `import TesseractCoreInit from 'tesseract.js-core/tesseract-core';`). Check the `node_modules/tesseract.js-core` directory for available `.js` files.
If using a `-simd` or `-relaxed-simd` build, try switching to a less optimized build (e.g., `tesseract-core` or `tesseract-core-lstm`) that uses a more widely compatible WebAssembly feature set. Ensure your environment is up-to-date.
Configure your web server to serve `.wasm` (and `.traineddata`) files from the root or the path where the `tesseract-core.js` wrapper expects them. Often, Emscripten modules expect the `.wasm` file to be co-located with the `.js` glue code or served from a configurable `locateFile` path.
No dependency data recorded yet.