extra-child-process 1.0.17
Install from the command line:
Learn more about npm packages
$ npm install @nodef/extra-child-process@1.0.17
Install via package.json:
"@nodef/extra-child-process": "1.0.17"
About this version
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();
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. |
- Node.js Child process API
- spawncommand package
- async-execute package
- spawndamnit package
- async-child-process package
- child-command package
- exec-then package
- child-process-async package
- faithful-exec package
- child-process-promise package
- superspawn package
- await-exec package
- command package
- spawn-please package
- process-promises package
- ts-process-promises package
- child-process-es6-promise package
- promise-exec package
- promisify-child-process package