1.2.0 • Published 7 years ago

nocr v1.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

nocr

Build Status

nocr is an OCR library pure JavaScript for node.js. We use ocrad.js.

Install

$ npm install nocr -S

How to use

image

Simple :

var nocr = require("nocr");
nocr.decodeFile("test/fixture/hello_world.png", function(error, data){
  console.log(data); // Hello World!
});

From Buffer:

var nocr = require("nocr");
var fs = require("fs");
var buffer = fs.readFileSync("test/fixture/hello_world.png");
nocr.decodeBuffer(buffer, function(error, data){
  console.log(data); // Hello World!
});

From Stream:

var nocr = require("nocr");
var fs = require("fs");
var stream = fs.createReadStream("test/fixture/hello_world.png");
nocr.decodeStream(stream, function(error, data){
  console.log(data); // Hello World!
});

Todo

  • JPG support
  • gif support
  • stream interface (i love pipe)