1const fs = require('fs')
2
3const dir = '/Users/flavio/folder'
4const files = fs.readdirSync(dir)
5
6for (const file of files) {
7 console.log(file)
8}
9
1const path = require('path')
2
3//...
4
5//inside the `for` loop
6const stat = fs.lstatSync(path.join(dir, file))
7