From b4880975516187dbf68ad22d75183291778ef672 Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Thu, 9 May 2019 00:51:44 +0800 Subject: [PATCH] Update README.md --- README.md | 31 +++++++++++-------------------- demo.gif => docs/demo.gif | Bin 2 files changed, 11 insertions(+), 20 deletions(-) rename demo.gif => docs/demo.gif (100%) diff --git a/README.md b/README.md index 090b1f3..32ea2d9 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,17 @@ Tesseract.js is a javascript library that gets words in [almost any language](./docs/tesseract_lang_list.md) out of images. ([Demo](http://tesseract.projectnaptha.com/)) -[![fancy demo gif](https://github.com/naptha/tesseract.js/blob/master/demo.gif)](http://tesseract.projectnaptha.com) +[![fancy demo gif](./docs/demo.gif)](http://tesseract.projectnaptha.com) -Tesseract.js works with script tags, [webpack](https://webpack.js.org/)/[Browserify](http://browserify.org/), and [Node.js](https://nodejs.org/en/). [After you install it](#installation), using it is as simple as +Tesseract.js works with script tags, [webpack](https://webpack.js.org/), and [Node.js](https://nodejs.org/en/). [After you install it](#installation), using it is as simple as - ```javascript -Tesseract.recognize(myImage) - .progress(function (p) { console.log('progress', p) }) - .then(function (result) { console.log('result', result) }) +```javascript +import { TesseractWorker } from 'tesseract.js'; +const worker = new TesseractWorker(); + +worker.recognize(myImage) + .progress(function(p) { console.log('progress', p) }) + .then(function()result) { console.log('result', result) }) ``` [Check out the docs](#docs) for a full treatment of the API. @@ -28,13 +31,13 @@ Tesseract.js wraps an [emscripten](https://github.com/kripken/emscripten) [port] # Installation -Tesseract.js works with a ` + ``` After including your scripts, the `Tesseract` variable will be defined globally! @@ -50,18 +53,6 @@ or ``` > Note: Tesseract.js currently requires Node.js v6.8.0 or higher. - -## Usage -```javascript -var Tesseract = require('tesseract.js') -``` - -or -```javascript -import Tesseract from 'tesseract.js' -``` - - # Docs * [Tesseract.recognize](#tesseractrecognizeimage-imagelike-options---tesseractjob) diff --git a/demo.gif b/docs/demo.gif similarity index 100% rename from demo.gif rename to docs/demo.gif