Muqriz 48f16bfc3e initail first | 4 달 전 | |
---|---|---|
.. | ||
index.d.ts | 4 달 전 | |
index.js | 4 달 전 | |
license | 4 달 전 | |
package.json | 4 달 전 | |
readme.md | 4 달 전 |
Filter out system junk files like
.DS_Store
andThumbs.db
$ npm install junk
const {promisify} = require('util');
const fs = require('fs');
const junk = require('junk');
const pReaddir = promisify(fs.readdir);
(async () => {
const files = await pReaddir('some/path');
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.
Regex used for matching junk files.
MIT © Sindre Sorhus