DR
Size: a a a
DR
KS
᠌
G
AG
AP
DR
ON
DR
KS
DR
DR
᠌
K
1
AS
KS
const exec = require('child_process').execFile;
/**
* Function to execute exe
* @param {string} fileName The name of the executable file to run.
* @param {string[]} params List of string arguments.
* @param {string} path Current working directory of the child process.
*/
function execute(fileName, params, path) {
let promise = new Promise((resolve, reject) => {
exec(fileName, params, { cwd: path },
(err, data) => {
if (err) reject(err);
else resolve(data);
});
});
return promise;
}
1
const exec = require('child_process').execFile;
/**
* Function to execute exe
* @param {string} fileName The name of the executable file to run.
* @param {string[]} params List of string arguments.
* @param {string} path Current working directory of the child process.
*/
function execute(fileName, params, path) {
let promise = new Promise((resolve, reject) => {
exec(fileName, params, { cwd: path },
(err, data) => {
if (err) reject(err);
else resolve(data);
});
});
return promise;
}
1