How to use the pn/child_process.spawn 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 / tools / sync-parserTests.js View on Github external
return new Promise(function(resolve, reject) {
			console.log('>>>', cmd.join(' '));
			childProcess.spawn(cmd[0], cmd.slice(1), {
				cwd: mwpath,
				env: process.env,
				stdio: 'inherit',
			}).on('close', function(code) {
				if (code === 0) {
					resolve(code);
				} else {
					reject(code);
				}
			}).on('error', reject);
		});
	};