junk
Filter out system junk files like .DS_Store and Thumbs.db
Last updated 3 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install junk 
SYNC missed versions from official npm registry.

junk

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

Install

$ npm install 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.

Current Tags

  • 4.0.0                                ...           latest (3 years ago)

14 Versions

  • 4.0.0                                ...           3 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.1.0                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.3                                ...           8 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.3.0                                ...           11 years ago
  • 0.2.2                                ...           11 years ago
  • 0.2.1                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |