{"id":20728800,"url":"https://github.com/codeclown/tesseract.js-node","last_synced_at":"2025-04-23T19:42:37.984Z","repository":{"id":97805185,"uuid":"210850502","full_name":"codeclown/tesseract.js-node","owner":"codeclown","description":"A focused, tested node-only version of tesseract.js.","archived":false,"fork":false,"pushed_at":"2023-03-03T07:14:06.000Z","size":5685,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T04:04:00.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeclown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-25T13:20:34.000Z","updated_at":"2021-06-27T10:23:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e1ccfb8-124a-4c39-81a3-4c89868f61df","html_url":"https://github.com/codeclown/tesseract.js-node","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"a60cb7131bf4e9d86b256636c423a3e3938f1550"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclown%2Ftesseract.js-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclown%2Ftesseract.js-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclown%2Ftesseract.js-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclown%2Ftesseract.js-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeclown","download_url":"https://codeload.github.com/codeclown/tesseract.js-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250501264,"owners_count":21440986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T04:40:02.649Z","updated_at":"2025-04-23T19:42:37.911Z","avatar_url":"https://github.com/codeclown.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tesseract.js-node\n\nA focused node-only version of tesseract.js.\n\n\n## Why?\n\n[tesseract.js](https://github.com/naptha/tesseract.js) is developed for both node and browser, and includes (in my opinion) bloated functionality like automatic downloading of traineddata-files in the background.\n\nAt the time of writing, it also does not have any tests for node-environment (only browser). Example issue where this matters: https://github.com/naptha/tesseract.js/issues/339.\n\nI just wanted a way to use Tesseract 4.0 in a node project without all this extra functionality and background downloads from third-party servers.\n\n\n## Usage\n\nDownload traineddata-files from somewhere, e.g. officially:\n\n```bash\nmkdir tessdata\ncd tessdata\ncurl -O -L https://github.com/tesseract-ocr/tessdata_fast/raw/master/eng.traineddata\ncurl -O -L https://github.com/tesseract-ocr/tessdata_fast/raw/master/fin.traineddata\n```\n\nThen use the library in a node project:\n\n```js\nconst getWorker = require('tesseract.js-node');\nconst worker = await getWorker({\n  tessdata: '/path/to/tessdata',    // where .traineddata-files are located\n  languages: ['eng', 'fin']         // languages to load\n});\nconst text = await worker.recognize('/path/to/image', 'eng');\n```\n\nYou can supply the input image in various ways:\n\n```js\n// path to image\nconst text = await worker.recognize('/path/to/image', 'eng');\n// Buffer\nconst text = await worker.recognize(fs.readFileSync('/path/to/image'), 'eng');\n// Buffer (from node-canvas)\nconst text = await worker.recognize(canvas.toBuffer('image/png'), 'eng');\n```\n\nSee [tesseract.test.js](test/tesseract.test.js) for other examples.\n\n\n## Development\n\n```bash\nnpm test\n```\n\nUseful resources:\n\n- https://tesseract-ocr.github.io/4.0.0/a02186.html#a96899e8e5358d96752ab1cfc3bc09f3e\n- https://github.com/naptha/tesseract.js-core/blob/v2.0.0-beta.11/examples/node/minimal/index.asm.js\n- https://github.com/jeromewu/tesseract.js-utils/blob/b5fba24a8ffcdd88302b5709a1023330138a281e/src/readImage.js\n\n\n## Credits\n\nThanks to [tesseract.js-core](https://github.com/naptha/tesseract.js-core) contributors for the groundwork!\n\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclown%2Ftesseract.js-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeclown%2Ftesseract.js-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclown%2Ftesseract.js-node/lists"}