4.0.1 • Published 13 days ago
@substrate-system/junk v4.0.1
junk
Filter out system junk files like
.DS_Store
andThumbs.db
fork
This is a fork of sindresorhus/junk.
Install
npm i -S @substrate-system/junk
Usage
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']
API
isJunk(filename)
Returns true
if filename
matches a junk file.
isNotJunk(filename)
Returns true
if filename
does not match a junk file.
junkRegex
Regex used for matching junk files.
4.0.1
13 days ago