Skip to content

Instantly share code, notes, and snippets.

View wrongbyte's full-sized avatar
🍊
I like orange juice

wrongbyte

🍊
I like orange juice
View GitHub Profile
const fs = require('fs');
const path = require('path')
filePath = process.argv[2]
extension = '.' + process.argv[3]
fs.readdir(filePath, function(err, lsContent){
if (err) return console.error(err)
lsContent = lsContent.filter(lsContent => path.extname(lsContent) == extension);
for (let i = 0; i < lsContent.length; i++){