execFile.js 455 B

123456789101112131415161718192021
  1. var childProcess = require('child_process')
  2. module.exports = function(options) {
  3. options = options || {}
  4. return function execFile () {
  5. var child = childProcess.execFile.apply(childProcess, arguments)
  6. if (!options.bufferStdout) {
  7. child.stdout.removeAllListeners('data')
  8. }
  9. if (!options.bufferStderr) {
  10. child.stderr.removeAllListeners('data')
  11. }
  12. return child
  13. }
  14. }