alvamind-workflow
Version:
A lightweight and flexible workflow automation library for JavaScript/TypeScript projects
19 lines • 721 B
JavaScript
import { exec } from 'child_process';
export function executeChildProcess(command) {
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
if (error && error.code === undefined) {
// This indicates a more serious error (like command not found)
reject(error);
return;
}
resolve({
exitCode: error ? error.code || 1 : 0, // Default to 1 if code is undefined but error exists
stdout: stdout.toString(),
stderr: stderr.toString()
});
});
});
}
export default executeChildProcess;
//# sourceMappingURL=executeChildProcess.js.map