How to use the pn/child_process.fork function in pn

To help you get started, we’ve selected a few pn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikimedia / parsoid / tests / mocha / foma.js View on Github external
l.variants.forEach(args => it(args.join(' '), function() {
					const cp = childProcess.fork(
						path.resolve(toolsDir, 'build-langconv-fst.js'),
						['-l'].concat(args),
						{
							cwd: fstDir,
						}
					);
					return new Promise((resolve,reject) => {
						cp.on('error', reject);
						cp.on('exit', (code, signal) => {
							if (code === 0) { resolve(); } else { reject(new Error("Bad exit code: " + code)); }
						});
					});
				}));
			});