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();
          });
      })
Source by www.staroceans.org.s3-website-us-east-1.amazonaws.com #
 
PREVIOUS NEXT
Tagged: #read #file #extension #folder #node #js
ADD COMMENT
Topic
Name
5+3 =