| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/framework7/node_modules/junk/ |
Upload File : |
# junk
> Filter out [system junk files](test.js) like `.DS_Store` and `Thumbs.db`
## Install
```
$ npm install junk
```
## Usage
```js
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.