Answers for "how to read file extension in a folder in node js"

1

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();
          });
      })
Posted by: Guest on February-08-2021

Code answers related to "how to read file extension in a folder in node js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language