diff --git a/dist/README.md b/dist/README.md index b7afa6b..a099853 100644 --- a/dist/README.md +++ b/dist/README.md @@ -1,4 +1,3 @@ # Using Tesseract.JS - diff --git a/examples/node/basic.js b/examples/node/basic.js new file mode 100644 index 0000000..89f6c3c --- /dev/null +++ b/examples/node/basic.js @@ -0,0 +1,6 @@ +var Tesseract = require('../../') // replace this with require('tesseract.js') + +Tesseract.recognize('cosmic.png') +.then(function(data){ + console.log(data.text) +}) \ No newline at end of file diff --git a/examples/node/cosmic.png b/examples/node/cosmic.png new file mode 100644 index 0000000..b78d9da Binary files /dev/null and b/examples/node/cosmic.png differ diff --git a/examples/node/detect.js b/examples/node/detect.js new file mode 100644 index 0000000..256ecfa --- /dev/null +++ b/examples/node/detect.js @@ -0,0 +1,9 @@ +var Tesseract = require('../../') // replace this with require('tesseract.js') + +Tesseract.detect('cosmic.png') +.progress(function(info){ + console.log(info) +}) +.then(function(data){ + console.log('done', data) +}) \ No newline at end of file diff --git a/examples/node/test.js b/examples/node/test.js deleted file mode 100644 index ba4e144..0000000 --- a/examples/node/test.js +++ /dev/null @@ -1,23 +0,0 @@ -var Tesseract = require('./src/index.js') -global.Tesseract = Tesseract; - -// Tesseract.recognize('yolop.png', { -// lang: 'eng' -// }).progress(function(info){ -// console.log('--', info) -// }) -// .then(function(data){ -// console.log('--', data) -// }) - - -// Tesseract.recognize('cosmic.jpg', { -// lang: 'eng' -// }) -Tesseract.detect('cosmic.jpg') -.progress(function(info){ - console.log(info) -}) -.then(function(data){ - console.log('done', data) -}) \ No newline at end of file diff --git a/package.json b/package.json index ae17618..ac47d0f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tesseract.js", "version": "1.0.0", "description": "Pure Javascript Multilingual OCR", - "main": "index.js", + "main": "src/index.js", "scripts": { "test": "echo \"Error: no test specified\" & exit 1", "start": "watchify src/index.js -o dist/tesseract.js --standalone Tesseract & watchify src/browser/worker.js -o dist/worker.js & http-server -p 7355",