package
Filter out system junk files like .DS_Store and Thumbs.db
npm install junkGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
4.2 kB
Includes dependencies.
Filter out system junk files like
.DS_StoreandThumbs.db
$ npm install junkimport 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.