{"id":16085826,"url":"https://github.com/zapolnoch/node-tesseract-ocr","last_synced_at":"2025-05-16T18:05:21.852Z","repository":{"id":38375520,"uuid":"152329128","full_name":"zapolnoch/node-tesseract-ocr","owner":"zapolnoch","description":"A Node.js wrapper for the Tesseract OCR API","archived":false,"fork":false,"pushed_at":"2023-07-13T18:17:01.000Z","size":528,"stargazers_count":311,"open_issues_count":24,"forks_count":38,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-16T18:03:26.981Z","etag":null,"topics":["image-to-text","ocr","tesseract","text-recognition"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zapolnoch.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":"2018-10-09T22:20:51.000Z","updated_at":"2025-04-26T14:10:09.000Z","dependencies_parsed_at":"2024-06-18T12:38:35.121Z","dependency_job_id":"cee1d93d-3db7-4187-b63e-3f7648be3782","html_url":"https://github.com/zapolnoch/node-tesseract-ocr","commit_stats":{"total_commits":42,"total_committers":6,"mean_commits":7.0,"dds":"0.30952380952380953","last_synced_commit":"0e2d696d95f7febd5f3380d4100f24cd3005f1f5"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapolnoch%2Fnode-tesseract-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapolnoch%2Fnode-tesseract-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapolnoch%2Fnode-tesseract-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapolnoch%2Fnode-tesseract-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zapolnoch","download_url":"https://codeload.github.com/zapolnoch/node-tesseract-ocr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582903,"owners_count":22095518,"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":["image-to-text","ocr","tesseract","text-recognition"],"created_at":"2024-10-09T13:09:31.250Z","updated_at":"2025-05-16T18:05:21.816Z","avatar_url":"https://github.com/zapolnoch.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Software"],"sub_categories":["OCR libraries by programming language"],"readme":"# Tesseract OCR for Node.js\n\n[![Build Status](https://img.shields.io/travis/zapolnoch/node-tesseract-ocr/master.svg?style=flat-square)](https://travis-ci.org/zapolnoch/node-tesseract-ocr)\n[![npm](https://img.shields.io/npm/v/node-tesseract-ocr.svg?style=flat-square)](https://www.npmjs.com/package/node-tesseract-ocr)\n[![npm](https://img.shields.io/npm/dm/node-tesseract-ocr.svg?style=flat-square)](https://www.npmjs.com/package/node-tesseract-ocr)\n[![Known Vulnerabilities](https://snyk.io/test/github/zapolnoch/node-tesseract-ocr/badge.svg)](https://snyk.io/test/github/zapolnoch/node-tesseract-ocr)\n\n## Installation\n\nFirst, you need to install the Tesseract project. Instructions for installing Tesseract for all platforms can be found on [the project site](https://github.com/tesseract-ocr/tessdoc/blob/master/Installation.md). On Debian/Ubuntu:\n\n```bash\napt-get install tesseract-ocr\n```\n\nAfter you've installed Tesseract, you can go installing the npm-package:\n\n```bash\nnpm install node-tesseract-ocr\n```\n\n## Usage\n\n```js\nconst tesseract = require(\"node-tesseract-ocr\")\n\nconst config = {\n  lang: \"eng\", // default\n  oem: 3,\n  psm: 3,\n}\n\nasync function main() {\n  try {\n    const text = await tesseract.recognize(\"image.jpg\", config)\n    console.log(\"Result:\", text)\n  } catch (error) {\n    console.log(error.message)\n  }\n}\n\nmain()\n```\n\nAlso you can pass URL:\n\n```js\nconst img = \"https://tesseract.projectnaptha.com/img/eng_bw.png\"\nconst text = await tesseract.recognize(img)\n```\n\nor Buffer:\n\n```js\nconst tesseract = require(\"node-tesseract-ocr\")\nconst fs = require(\"fs/promises\")\n\nasync function main() {\n  const img = await fs.readFile(\"image.jpg\")\n  const text = await tesseract.recognize(img)\n\n  console.log(\"Result:\", text)\n}\n```\n\nIf you want to process multiple images in a single run, then pass an array:\n\n```js\nconst images = [\"./samples/file1.png\", \"./samples/file2.png\"]\nconst text = await tesseract.recognize(images)\n```\n\nIn the config object you can pass any [OCR options](https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#options). Also you can pass here any [control parameters](https://tesseract-ocr.github.io/tessdoc/tess3/ControlParams) or use ready-made sets of [config files](https://github.com/tesseract-ocr/tesseract/tree/master/tessdata/configs) (like hocr):\n\n```js\nawait tesseract.recognize(\"image.jpg\", {\n  load_system_dawg: 0,\n  tessedit_char_whitelist: \"0123456789\",\n  presets: [\"tsv\"],\n})\n```\n\n## Alternatives\n\nIf you want to use Tesseract in the browser, choose [Tesseract.js](https://github.com/naptha/tesseract.js) package, which compiles original Tesseract from C to JavaScript WebAssembly. You can also use it in Node.js, but the performance may not be as good.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapolnoch%2Fnode-tesseract-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzapolnoch%2Fnode-tesseract-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapolnoch%2Fnode-tesseract-ocr/lists"}