extra-cp

Promise interface for child_process.

Usage no npm install needed!

<script type="module">
  import extraCp from 'https://cdn.skypack.dev/extra-cp';
</script>

README

Promise interface for child_process.

const cp = require('extra-cp');
// cp.exec(command, options)
// cp.execFile(file, args, options)


// With Promise:
var {stdout, stderr} = await cp.exec('ls -a', {cwd: '/home'});
var {stdout, stderr} = await cp.execFile('ls', ['-a'], {cwd: '/home'});

// Without Promise:
cp.exec('ls -a', {cwd: '/home'}, (err, stdout, stderr) => 0);
cp.execFile('ls', ['-a'], {cwd: '/home'}, (err, stdout, stderr) => 0);