Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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();
          });
      })
 
PREVIOUS NEXT
Tagged: #read #file #extension #folder #node #js
ADD COMMENT
Topic
Name
9+4 =