How can I call the execFile method from child_process to run a bash script that returns a list of values?
My bash file (test.sh) returns a list of 8 values but the below script is printing only the last item of the list.
const { execFile } = require('child_process');
const child = execFile('./test.sh', (error,stdout,stderror) => {
if (error) {
throw error;
}
console.log(stdout);
});