npm.io
1.1.3 • Published 4 years ago

extra-cp

Licence
BSD-3-Clause
Version
1.1.3
Deps
0
Size
6 kB
Vulns
0
Weekly
22
Stars
2
DeprecatedThis package is deprecated

Useful additions to inbuilt child_process module.
Node.js, Files, Docs, Survey.

Stability: Experimental.


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

async function main() {
  // 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);
}
main();


Index

Property Description
exec Execute a command within a shell, buffering any output.
execAsync Execute a command within a shell, buffering any output.
execFile Execute an executable without a shell by default, buffering any output.
execFileAsync Execute an executable without a shell by default, buffering any output.
spawnAsync Spawn new process using given command and arguments.


References



Keywords