Answers for "list all files in director node"

1

get all from dir node

const getAllFromDir = source =>
      fs.readdirSync(source).map(name => path.join(source, name));
      console.log(getDirectories("C:/"));
Posted by: Guest on October-06-2020
2

how to get file name in directory node js

const path = require('path')

//...

//inside the `for` loop
const stat = fs.lstatSync(path.join(dir, file))
Posted by: Guest on October-16-2020

Code answers related to "list all files in director node"

Code answers related to "Javascript"

Browse Popular Code Answers by Language