Socket
Book a DemoInstallSign in
Socket

junk

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

junk

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

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
2.8M
-10.77%
Maintainers
1
Weekly downloads
 
Created
Source

junk Build Status

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

Install

$ npm install --save junk

Usage

var fs = require('fs');
var junk = require('junk');

fs.readdir('path', function (err, files) {
	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.re

The regex used for matching.

License

MIT © Sindre Sorhus

Keywords

junk

FAQs

Package last updated on 22 Feb 2015

Did you know?

Socket

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