Install npm install dir_filenames --save How to use const dir = require('dir_filenames') const filenames = dir(__dirname) console.log(filenames)