junk

Filter out OS junk files like .DS_Store and Thumbs.db

junk

Filter out OS junk files like .DS_Store and Thumbs.db

$ npm install --save junk
var fs = require('fs');
var junk = require('junk');
 
fs.readdir('path', function (errfiles) {
    console.log(files);
    //=> ['.DS_Store', 'test.jpg'] 
 
    console.log(files.filter(junk.not));
    //=> ['test.jpg'] 
});

Returns true if filename matches a junk file.

Returns true if filename doesn't match a junk file.

The regex used for matching.

MIT © Sindre Sorhus