junk ![Build Status](https://camo.githubusercontent.com/410ba495cbdf94eb2b152381034f6b2343ea009a7aaa93c215edba4e761c9d52/68747470733a2f2f7472617669732d63692e6f72672f73696e647265736f726875732f6a756e6b2e7376673f6272616e63683d6d6173746572)
Filter out system junk files like
.DS_Store
andThumbs.db
Install
$ npm install junk
Usage
const {promises: fs} = require('fs');
const junk = require('junk');
(async () => {
const files = await fs.readdir('some/path');
console.log(files);
//=> ['.DS_Store', 'test.jpg']
console.log(files.filter(junk.not));
//=> ['test.jpg']
})();
API
junk.is(filename)
Returns true
if filename
matches a junk file.
junk.not(filename)
Returns true
if filename
doesn't match a junk file.
junk.regex
Regex used for matching junk files.
License
MIT © Sindre Sorhus