import { spawn } from 'child_process' ; param fileName export function executeChildProcess ( fileName , args ) { return new Promise ( ( resolve , reject ) => { const child = spawn ( fileName , args ) ; child . on ( 'exit' , ( code ) => { if ( code !== 0 ) { return reject ( new Error ( fileName + ' exited with code: ' + code ) ) ; } return resolve ( ) ; } ) ; child . stdin . end ( ) ; } ) ; }