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

Comparing version 0.3.0 to 1.0.0

44

index.js
'use strict';
exports.rules = [
// All
/^npm-debug\.log$/, // npm error log
/^\..*\.swp$/, // vim state
// OS X
/^\.DS_Store/, // stores custom folder attributes
/^\.AppleDouble$/, // stores additional file resources
/^\.LSOverride$/, // contains the absolute path to the app to be used
/^Icon[\r\?]?/, // custom Finder icon
/^\._.*/, // thumbnail
/^.Spotlight-V100$/, // file that might appear on external disk
/\.Trashes/, // file that might appear on external disk
/^__MACOSX$/, // resource fork
// Linux
/~$/, // backup file
// Windows
/^Thumbs\.db$/, // image file cache
/^ehthumbs\.db$/, // folder config file
/^Desktop\.ini$/ // stores custom folder attributes
];
// // All
// /^npm-debug\.log$/, // npm error log
// /^\..*\.swp$/, // vim state
// // OS X
// /^\.DS_Store/, // stores custom folder attributes
// /^\.AppleDouble$/, // stores additional file resources
// /^\.LSOverride$/, // contains the absolute path to the app to be used
// /^Icon[\r\?]?/, // custom Finder icon
// /^\._.*/, // thumbnail
// /^.Spotlight-V100$/, // file that might appear on external disk
// /\.Trashes/, // file that might appear on external disk
// /^__MACOSX$/, // resource fork
// // Linux
// /~$/, // backup file
// // Windows
// /^Thumbs\.db$/, // image file cache
// /^ehthumbs\.db$/, // folder config file
// /^Desktop\.ini$/ // stores custom folder attributes
exports.re = /^npm-debug\.log$|^\..*\.swp$|^\.DS_Store|^\.AppleDouble$|^\.LSOverride$|^Icon[\r\?]?|^\._.*|^.Spotlight-V100$|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^Desktop\.ini$/;
exports.is = function (filename) {
return exports.rules.some(function (rule) {
return rule.test(filename);
});
return exports.re.test(filename);
};

@@ -29,0 +27,0 @@

{
"name": "junk",
"version": "0.3.0",
"version": "1.0.0",
"description": "Filter out OS junk files like .DS_Store and Thumbs.db",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "mocha"
"test": "node test.js"
},

@@ -35,4 +35,4 @@ "files": [

"devDependencies": {
"mocha": "*"
"ava": "0.0.3"
}
}

@@ -1,2 +0,2 @@

# junk [![Build Status](https://travis-ci.org/sindresorhus/junk.png?branch=master)](https://travis-ci.org/sindresorhus/junk)
# junk [![Build Status](https://travis-ci.org/sindresorhus/junk.svg?branch=master)](https://travis-ci.org/sindresorhus/junk)

@@ -8,3 +8,3 @@ > Filter out [OS junk files](test.js) like `.DS_Store` and `Thumbs.db`

```bash
```sh
$ npm install --save junk

@@ -14,3 +14,3 @@ ```

## Example
## Usage

@@ -35,11 +35,11 @@ ```js

Returns true if `filename` matches any of the `junk.rules`.
Returns true if `filename` matches a junk file.
### junk.not(filename)
Returns true if `filename` doesn't match any of the `junk.rules`.
Returns true if `filename` doesn't match a junk file.
### junk.rules
### junk.re
Returns an array of regexes you can match against.
The regex used for matching.

@@ -49,2 +49,2 @@

[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](http://sindresorhus.com)
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