How can I index a directory in nodeJS then save it to a variable?
I do not have any code to show my attempts, as I do not know what code to try.
How can I index a directory in nodeJS then save it to a variable?
I do not have any code to show my attempts, as I do not know what code to try.
Check this How do you get a list of the names of all files present in a directory in Node.js?
But a dumb answer is:
var files = require('fs').readdirSync('.');