Skip to content

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.

License

Notifications You must be signed in to change notification settings

enfp-dev-studio/node-uni-ocr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@enfpdev/node-uni-ocr

CI

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 engine (written in Rust) via 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

pnpm add @enfpdev/node-uni-ocr
# or
npm install @enfpdev/node-uni-ocr

Usage

ESM (import) Example

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);

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published