https://github.com/enfp-dev-studio/node-uni-ocr
Native Node.js/Electron OCR library powered by Rust uniOCR via napi-rs. Cross-platform, fast, and easy system-level OCR for Windows, macOS. No native build setup required for end users.
https://github.com/enfp-dev-studio/node-uni-ocr
electron macos napi-rs nodejs ocr rust system-ocr uniocr windows
Last synced: 5 months ago
JSON representation
Native Node.js/Electron OCR library powered by Rust uniOCR via napi-rs. Cross-platform, fast, and easy system-level OCR for Windows, macOS. No native build setup required for end users.
- Host: GitHub
- URL: https://github.com/enfp-dev-studio/node-uni-ocr
- Owner: enfp-dev-studio
- License: mit
- Created: 2025-07-17T10:00:36.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-17T13:55:22.000Z (6 months ago)
- Last Synced: 2025-07-29T06:49:41.517Z (5 months ago)
- Topics: electron, macos, napi-rs, nodejs, ocr, rust, system-ocr, uniocr, windows
- Language: JavaScript
- Homepage:
- Size: 170 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @enfpdev/node-uni-ocr

## Description
**@enfpdev/node-uni-ocr** is a native Node.js library that brings system-level OCR (Optical Character Recognition) to Node.js and Electron by porting the [uniOCR](https://github.com/hiroi-sora/uni-ocr) engine (written in Rust) via [napi-rs](https://napi.rs/).
It enables easy, cross-platform OCR functionality (Windows, macOS, and experimental WASI/Linux) without requiring users to set up complex build tools or environments.
---
## Installation
```bash
pnpm add @enfpdev/node-uni-ocr
# or
npm install @enfpdev/node-uni-ocr
```
## Usage
### ESM (import) Example
```js
import { recognize } from '@enfpdev/node-uni-ocr';
import fs from 'fs';
// OCR from file path
const result = await recognize('test.png');
console.log(result.text, result.confidence);
// OCR from buffer
const buffer = fs.readFileSync('test.png');
const result2 = await recognize(buffer, {
languages: ['en', 'ko'],
confidence_threshold: 0.5,
timeout: 10,
});
console.log(result2.text);
```