How to execute an external program from within Node.js?


Question

Is it possible to execute an external program from within node.js? Is there an equivalent to Python's os.system() or any library that adds this functionality?

1
130
2/13/2018 8:24:45 AM

var exec = require('child_process').exec;
exec('pwd', function callback(error, stdout, stderr){
    // result
});
130
11/2/2016 6:39:09 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon