
Research
Using Trusted Protocols Against You: Gmail as a C2 Mechanism
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
node-tesseract-ocr
Advanced tools
First, you need to install the Tesseract project. Instructions for installing Tesseract for all platforms can be found on the project site. On Debian/Ubuntu:
apt-get install tesseract-ocr
After you've installed Tesseract, you can go installing the npm-package:
npm install node-tesseract-ocr
const tesseract = require("node-tesseract-ocr")
const config = {
lang: "eng",
oem: 1,
psm: 3,
}
tesseract
.recognize("image.jpg", config)
.then((text) => {
console.log("Result:", text)
})
.catch((error) => {
console.log(error.message)
})
Also you can pass Buffer:
const img = fs.readFileSync("image.jpg")
tesseract
.recognize(img, config)
.then((text) => {
console.log("Result:", text)
})
.catch((error) => {
console.log(error.message)
})
or URL:
const img = "https://tesseract.projectnaptha.com/img/eng_bw.png"
tesseract
.recognize(img, config)
.then((text) => {
console.log("Result:", text)
})
.catch((error) => {
console.log(error.message)
})
If you want to process multiple images in a single run, then pass an array:
const images = ["./test/samples/file1.png", "./test/samples/file2.png"]
tesseract
.recognize(images, config)
.then((text) => {
console.log("Result:", text)
})
.catch((error) => {
console.log(error.message)
})
In the config object you can pass any OCR options. Also you can pass here any control parameters or use ready-made sets of config files (like hocr):
const result = await tesseract.recognize("image.jpg", {
load_system_dawg: 0,
tessedit_char_whitelist: "0123456789",
presets: ["tsv"],
})
FAQs
A Node.js wrapper for the Tesseract OCR API
The npm package node-tesseract-ocr receives a total of 15,948 weekly downloads. As such, node-tesseract-ocr popularity was classified as popular.
We found that node-tesseract-ocr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.