Using shelljs on Windows and storing the output of a process

I am trying to use shelljs (https://github.com/arturadib/shelljs) for a project I am working on, it works like a charm on Unix based systems but once I try to use it on Windows, I am able to launch a process but I am totally unable to get the output of that process. The documentation mentioned that any of the ways below to get output should work but none of them do on Windows, any suggestions?

var version = exec('node --version', {silent:true}).output;

var child = exec('some_long_running_process', {async:true});
child.stdout.on('data', function(data) {
  /* ... do something with data ... */
});

exec('some_long_running_process', function(code, output) {
  console.log('Exit code:', code);
  console.log('Program output:', output);
});

Answers:

Answer

Try to do this:

child.on("data",function(data){...}

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.