@cloud-cli/exec
v1.2.1
Published
Promise wrapper for child_process.spawn
Downloads
30
Readme
Wrapper for child_process.exec
Usage
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);
});