1.1.3 ā€¢ Published 2 years ago

extra-cp v1.1.3

Weekly downloads
7
License
BSD-3-Clause
Repository
github
Last release
2 years ago

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

PropertyDescription
execExecute a command within a shell, buffering any output.
execAsyncExecute a command within a shell, buffering any output.
execFileExecute an executable without a shell by default, buffering any output.
execFileAsyncExecute an executable without a shell by default, buffering any output.
spawnAsyncSpawn new process using given command and arguments.

References

npm.io

1.1.3

2 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago