https://github.com/uk0/ocr-nodejs
https://github.com/uk0/ocr-nodejs
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/uk0/ocr-nodejs
- Owner: uk0
- License: other
- Created: 2017-06-13T15:47:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-12-15T02:42:08.000Z (over 4 years ago)
- Last Synced: 2025-09-01T21:45:38.171Z (9 months ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
ng-ocr
============
[](https://travis-ci.org/breakEval13/OCR-NODEJS)
[](https://npmjs.org/package/ng-ocr)
[](https://npmjs.org/package/ng-ocr)
Ngocr is an OCR library pure JavaScript for node.js.
We use [ocrad.js](https://github.com/antimatter15/ocrad.js/).
Install
---------
```bash
$ npm install ng-ocr -S
```
How to use
---------

Simple :
```javascript
var Ngocr = require("ng-ocr");
Ngocr.decodeFile("test/fixture/hello_world.png", function(error, data){
console.log(data); // Hello World!
});
```
From Buffer:
```javascript
var Ngocr = require("ng-ocr");
var fs = require("fs");
var buffer = fs.readFileSync("test/fixture/hello_world.png");
Ngocr.decodeBuffer(buffer, function(error, data){
console.log(data); // Hello World!
});
```
From Stream:
```javascript
var Ngocr = require("ng-ocr");
var fs = require("fs");
var stream = fs.createReadStream("test/fixture/hello_world.png");
Ngocr.decodeStream(stream, function(error, data){
console.log(data); // Hello World!
});
```
Todo
----------
- JPG support
- gif support
- stream interface (i love pipe)