Cross platform
execFile
$ npm install cross-exec-file
const crossExecFile = require('cross-exec-file');
crossExecFile('cli.js', ['unicorn']).then(res) => {
console.log(res.stdout);
//=> 'unicorns & rainbows'
});
Returns a Promise for a result Object with stdout and stderr properties.
Type: string
Path to your binary to be ran.
Type: Array
Arguments to run your binary with.
Type: Object
Provide options to be used with execFile
child_processspawn and spawnSyncMIT © Kevin Martensson