13 var exec = require('child_process').exec,
15 var child = exec('cat *.js bad_file | wc -l',
16 function (error, stdout, stderr) {
17 console.log('stdout: ' + stdout);
18 console.log('stderr: ' + stderr);
20 console.log('exec error: ' + error);
26 info = require('../package.json')
29 process.stdout.write(util.inspect(objekt, false, Infinity, true) + '\n');
31 ## Spawn - passthru the in/out
33 var spawn = require('child_process').spawn;
34 var proc = spawn(bin, argv, { stdio: 'inherit' });
35 proc.on('error', function(err) {
36 if (err.code == "ENOENT") { "does not exist" }
37 if (err.code == "EACCES") { "not executable" }
39 proc.on('exit', function(code) { ... });
41 // also { stdio: ['pipe', 'pipe', process.stdout] }
42 // also { stdio: [process.stdin, process.stderr, process.stdout] }
44 proc.stdout.on('data', function (data) {
46 proc.stderr.on('data', function (data) {
49 [all]: http://nodejs.org/api/all.html