example.js
1 var execSh = require('../') 2 3 // run interactive bash shell 4 execSh('echo ola && bash', { cwd: '/home' }, function (err) { 5 if (err) { 6 console.log('Exit code: ', err.code) 7 return 8 } 9 10 // collect streams output 11 execSh(['bash -c id', 'echo olaola >&2'], true, 12 function (err, stdout, stderr) { 13 console.log('error: ', err) 14 console.log('stdout: ', stdout) 15 console.log('stderr: ', stderr) 16 }) 17 })