надо использовать Promise и Resolve, но не знаю, как это сделать.
                  
                  
                  
                  
                  
                  Tesseract.recognize(
                  
                  
                    'image.jpeg'
                  
                  
                  ).then(({ data: { text } }) => {
                  
                  
                    console.log(text);
                  
                  
                  })
                  
                  
                
const result = await Tesseract.recognize( 'image.jpeg' ).then(({ data: { text } }) => text)
Ничего не выдаёт, выполняю так (async () => { result = await Tesseract.recognize( 'image.jpeg' ).then(({ data: { text } }) => text) console.log(result) }) UPD: Такой вариант работает (async () => { const { data: { text } } = await Tesseract.recognize('image.jpeg') console.log(text); })();
Обсуждают сегодня