1

Trying to call a bash-scripts's function from another script written in NodeJS.

0

1 Answer 1

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);
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.