Answers for "get filename in current directory node js"

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
0

node get path of current file

module.filename
Posted by: Guest on February-22-2021

Code answers related to "get filename in current directory node js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language