I've revised the question to help people understand what I'm looking for help with. I have a directory tree as follows:
--action
--a.js
--b.js
--c.js
--d.js
--data
--list.js
--export
--exp.js
Files js: a, b, c, d all have 1 function as follows:
module.export = {
"test": function name () {
//do something
}
}
In the list.js file. I have an array like this.
const list = [ 'a', 'b' ];
At the exp.js file, I want to export all js files in the action directory through an array in the list.js
Desired: use the loop to import multiple js files and export all those js files.
Thank you everyone for reading and helping.