Welcome to mirror list, hosted at ThFree Co, Russian Federation.

spawnWorker.js « node « worker « src - github.com/naptha/tesseract.js.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c538244b86ec7a95f290e4b280faacce9c8bd3af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const { fork } = require('child_process');

let debugPort = 9229;

/**
 * spawnWorker
 *
 * @name spawnWorker
 * @function fork a new process in node
 * @access public
 */
module.exports = ({ workerPath }) => {
  debugPort += 1;
  return fork(workerPath, [], { execArgv: [`--debug-port=${debugPort}`] });
};