junk

WebJar for junk

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

junk
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

junk
WebJar for junk
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/junk

Download junk

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/junk/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>junk</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/junk/
implementation 'org.webjars.npm:junk:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/junk/
implementation ("org.webjars.npm:junk:2.1.0")
'org.webjars.npm:junk:jar:2.1.0'
<dependency org="org.webjars.npm" name="junk" rev="2.1.0">
  <artifact name="junk" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='junk', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "junk" % "2.1.0"
[org.webjars.npm/junk "2.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

junk Build Status

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

Install

$ npm install junk

Usage

const {promises: fs} = require('fs');
const junk = require('junk');

(async () => {
	const files = await fs.readdir('some/path');

	console.log(files);
	//=> ['.DS_Store', 'test.jpg']

	console.log(files.filter(junk.not));
	//=> ['test.jpg']
})();

API

junk.is(filename)

Returns true if filename matches a junk file.

junk.not(filename)

Returns true if filename doesn't match a junk file.

junk.regex

Regex used for matching junk files.

License

MIT © Sindre Sorhus

Versions

Version
2.1.0
1.0.0