
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
node-native-ocr
Advanced tools
The native Node.js bindings to the Tesseract OCR project using N-API and node-addon-api.
Benefits:
tesseract
command line.buffer
s.Contributions are welcome.
Via npm:
$ npm install node-native-ocr
import {
recognize
} from 'node-native-ocr'
import fs from 'fs-extra'
const filepath = path.join(__dirname, 'test', 'fixtures', 'node-native-ocr.jpg')
fs.readFile(filepath).then(recognize).then(console.log) // 'node-native-ocr'
Buffer
the content buffer of the image file.node-native-ocrOptions=
optionalReturns Promise.<String>
the recognized text if succeeded.
node-native-ocrOptions
Object
{
// @type `(String|Array.<String>)=eng`,
//
// Specifies language(s) used for OCR.
// Run `tesseract --list-langs` in command line for all supported languages.
// Defaults to `'eng'`.
//
// To specify multiple languages, use an array.
// English and Simplified Chinese, for example:
// ```
// lang: ['eng', 'chi_sim']
// ```
lang: 'eng'
}
Promise.reject(error)
Error
The JavaScript Error
instance
String
Error code.String
Error message.Error
.ERR_READ_IMAGE
Rejects if it fails to read image data from file or buffer.
ERR_INIT_TESSER
Rejects if tesseract fails to initialize
// For details of `mainWindow: BrowserWindow`, see
// https://github.com/electron/electron/blob/master/docs/api/browser-window.md
mainWindow.capturePage({
x: 10,
y: 10,
width: 100,
height: 10
}, (data) => {
recognize(data.toPNG()).then(console.log)
})
For Mac OS users, if you are experiencing trouble when compiling, run the following command:
$ xcode-select --install
will resolve most problems.
Warnings:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
resolver:
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
MIT
FAQs
Native Node.js bindings for the Tesseract OCR project.
The npm package node-native-ocr receives a total of 164 weekly downloads. As such, node-native-ocr popularity was classified as not popular.
We found that node-native-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
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.