const { createWorker, createScheduler } = require('../../'); const scheduler = createScheduler(); // Creates worker and adds to scheduler const workerGen = async () => { const worker = await createWorker({cachePath: "."}); await worker.loadLanguage('eng'); await worker.initialize('eng'); scheduler.addWorker(worker); } const workerN = 4; (async () => { const resArr = Array(workerN); for (let i=0; i ( scheduler.addJob('recognize', 'https://tesseract.projectnaptha.com/img/eng_bw.png').then((x) => console.log(x.data.text)) ))) await scheduler.terminate(); // It also terminates all workers. })();