I have about 100 JS files with each having different script.
file1.js , file2.js , file3.js , ... , file100.js
Right now, to execute each file I have to go to my terminal and do this:
node file1
node file2
node file3
.
.
node file100
That means I have to do this 100 times in the terminal. Is there a script to write in a JS file so I can execute ONLY ONE JS file that would execute all the 100 JS files in sequence?
I also want to give 3 seconds waiting between each execution which I believe I can achieve with the following code:
var interval = 3000;
var promise = Promise.resolve();
promise = promise.then(function () {
return new Promise(function (resolve) {
setTimeout(resolve, interval);
});
});
Any suggestion how to execute all the 100 JS files without typing node file# 100 times in the terminal?