how to read file extension in a folder in node js

Solutions on MaxInterview for how to read file extension in a folder in node js by the best coders in the world

showing results for - "how to read file extension in a folder in node js"
Debora
31 Feb 2017
1fs.readdir('./', (err, files) => {
2        files.forEach(file => {
3        //   console.log(file);
4         // read extension
5          const extension = file.split(".").pop();
6          });
7      })