Answers for "read file names in a folder javascript"

3

how to get file name in directory node js

const fs = require('fs')

const dir = '/Users/flavio/folder'
const files = fs.readdirSync(dir)

for (const file of files) {
  console.log(file)
}
Posted by: Guest on October-16-2020
1

javascript get list of files in directory

var fs = require('fs');
var files = fs.readdirSync('/downloads');
Posted by: Guest on December-08-2020

Code answers related to "read file names in a folder javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language