I'm kinda new to coding, and I need to count files with specific type in my folder, but I don't know how to do it using fs module!
My current code:
const fs = require('fs');
fs.readdir(dir, (err, files) => {
console.log(files.length)
});
Can someone help me?