-1

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.

AlexDoe
  • 181
  • 1
  • 2
  • 8

1 Answers1

0

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('.');

Community
  • 1
  • 1
natanael
  • 230
  • 1
  • 7