ocr-command-line-tool
Advanced tools
Comparing version 1.0.2 to 1.0.3
20
index.js
@@ -7,13 +7,19 @@ const Tesseract = require('tesseract.js') | ||
load.frame(["\\", "|", "/", "–",]); | ||
load.color = 'white'; | ||
load.text = 'Loading'; | ||
await Tesseract.recognize( | ||
load.color = 'yellow'; | ||
load.text = ' Loading'; | ||
var bruh = await Tesseract.recognize( | ||
x, | ||
'eng', | ||
{ } | ||
).then(function ({ data: { text } }) { | ||
fs.writeFile(y, text, function (err) {}); | ||
load.stop() | ||
console.log("Successfully wrote to file."); | ||
).then(async function ({ data: { text } }) { | ||
if(typeof y == "string"){ | ||
await fs.writeFile(y, text, function (err) {}); | ||
console.log("Successfully wrote to file."); | ||
} else { | ||
console.log("\n") | ||
return text | ||
} | ||
}) | ||
load.stop() | ||
return bruh | ||
} | ||
@@ -20,0 +26,0 @@ module.exports = { |
{ | ||
"name": "ocr-command-line-tool", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Scan images on CLI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# OCR Command Line Tool | ||
OCR Command Line tool (OCR-CLT) is a global Node package that uses OCR technology to extract text from images. It is based on the Tesseract JS OCR library, so it is very efficient. | ||
## Installation | ||
Using npm: | ||
Using npm to install CLI tool: | ||
```shell | ||
@@ -9,2 +10,7 @@ $ npm install -g npm | ||
``` | ||
Using npm to install module: | ||
```shell | ||
$ npm install -g npm | ||
$ npm install ocr-command-line-tool | ||
``` | ||
@@ -16,4 +22,13 @@ ## Example | ||
``` | ||
In NodeJS: | ||
```js | ||
const ocrCommandLineTool = require("./index.js").ocr | ||
async function getText (imagepath) { | ||
var mytext = await ocrCommandLineTool(imagepath) | ||
console.log(mytext) | ||
} | ||
getText('<path to image>') | ||
``` | ||
## Why OCR-CLT? | ||
OCR-CLT text recognition easy with a simple command. Beyond this, most other competitors are made as API's, which come with hefty fees. Here, you can use the tool right from your own computer for free! Additionally you can take advantage of all the power your computer has. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42642
6
34
32