# junk

> Filter out system junk files like .DS_Store and Thumbs.db

Latest version **4.0.1** (published 2023-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install junk
pnpm add junk
yarn add junk
bun add junk
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2023-04-19 |
| First published | 2013-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=12.20 |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 246 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | junk, trash, garbage, files, os, ignore, exclude, filter, temp, tmp, system, clean, cleanup |

## Links

- npm: https://www.npmjs.com/package/junk
- Repository: https://github.com/sindresorhus/junk
- Homepage: https://github.com/sindresorhus/junk#readme
- Issues: https://github.com/sindresorhus/junk/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/junk

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 4.0.1 (latest) — 2023-04-19
- 4.0.0 — 2021-07-28
- 3.1.0 — 2019-04-02
- 3.0.0 — 2019-03-18
- 2.1.0 — 2017-02-27
- 2.0.0 — 2016-08-27
- 1.0.3 — 2016-06-17
- 1.0.2 — 2015-06-29
- 1.0.1 — 2015-02-22
- 1.0.0 — 2014-08-09
- 0.3.0 — 2014-03-06
- 0.2.2 — 2013-12-07
- 0.2.1 — 2013-05-05
- 0.2.0 — 2013-05-04
- 0.1.0 — 2013-05-04

## README

# 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.

---
_Source: https://npm.io/package/junk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
