read extension of file in node js code example
Example: how to read file extension in a folder in node js
fs.readdir('./', (err, files) => {
files.forEach(file => {
// console.log(file);
// read extension
const extension = file.split(".").pop();
});
})