#bash#shell#scriptRead all file names in a directoryPublished onPublished onAug 28, 2021/1 mins read/---Required: node.js installation.Quickly get all files' names inside a folderconsole.log(fs.readdirSync('./folder-path'))Example:# Make sure node.js installed node -v v22.9.0 # Now it's good to go node > console.log(fs.readdirSync('./folder')) [ '.DS_Store', 'authors', 'blog', 'headerNavLinks.js', 'logo.svg', 'projectsData.js', 'SITE_METADATA.js', 'snippets' ]