child_process.exec
Wrapper forUsage
As a function:
import { exec } from '@cloud-cli/exec';
// ...
const { stdout, ok } = await exec('ls', ['-l']);
if (ok) {
console.log(stdout);
}
As an event emitter:
import { Process } from '@cloud-cli/exec';
import { spawn } from 'child_process';
const ps = new Process(spawn('ls', ['-l']));
ps.on('done', (result) => {
console.log(result.ok, result.stdout);
});