@cloud-cli/exec
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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);
});

Readme

Keywords

Package Sidebar

Install

npm i @cloud-cli/exec

Weekly Downloads

9

Version

1.2.1

License

MIT

Unpacked Size

9.83 kB

Total Files

7

Last publish

Collaborators

  • darlanalves