UNPKG

suf-node

Version:
19 lines (18 loc) 591 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Exec = void 0; const child_process_1 = require("child_process"); async function Exec(command, options) { return new Promise((res, rej) => { const ref = child_process_1.exec(command, {}, (err, stdout, stderr) => { if (err) { return rej(err); } res({ stdout, stderr }); }); if (options?.linkStdout) { ref.stdout?.on('data', (d) => process.stdout.write(d)); } }); } exports.Exec = Exec;