You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
462 B
Markdown

# Child Process Module
- spawn
```javascript
var spawn = require('child_process').spawn;
var child = spawn('some-command', ['--with', 'flags'])
child.stdout.on('data', function (data) {...})
child.stderr.on('data', function (data) {...})
child.on('exit', function (code) {...})
child.kill('SIGKILL')
```
- execFile
```javascript
var execFile = require('child_process').execFile;
execFile('some-command', ['flags'], null, function (err, stdout, stderr) {
})
```