Socket
Socket
Sign inDemoInstall

junk

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

junk

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


Version published
Maintainers
1
Weekly downloads
2,234,702
decreased by-27.33%

Weekly downloads

Readme

Source

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.

Keywords

FAQs

Last updated on 19 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc