Problem: I have a very simple script using tesseract.js locally (which getting to work was a pain of its own), and when i run the function, it logs my text and hangs without ever moving onto anything after the tesseract function.
var Tesseract = require('tesseract.js');
Tesseract.workerOptions.langPath = './eng.traineddata';
function parseImg(img){
Tesseract.recognize(img)
.then(result => console.log(result.text))
};
parseImg('./undefined.jpeg')
The function does work, and it does log the text from my image, but i cant figure out how to break from the function. Any guidance would be greatly appreciated!