Filter out system junk files like
.DS_Store
andThumbs.db
$ npm install junk
import fs from 'node:fs/promises';
import {isNotJunk} from 'junk';
const files = await fs.readdir('some/path');
console.log(files);
//=> ['.DS_Store', 'test.jpg']
console.log(files.filter(isNotJunk));
//=> ['test.jpg']
Returns true
if filename
matches a junk file.
Returns true
if filename
does not match a junk file.
Regex used for matching junk files.