Trying to call a bash-scripts's function from another script written in NodeJS.
Asked
Active
Viewed 590 times
1 Answers
0
You can run a bash script in Node.js using child_process
' exec
var exec = require('child_process').exec;
exec('./yourscript.sh <args>',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});

alejandromav
- 933
- 1
- 11
- 24