Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-match

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-match

Match filepath is validated, or exclude filepath that don't need.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
73K
decreased by-0.31%
Maintainers
1
Weekly downloads
 
Created
Source

file-match

Match filepath is validated, or exclude filepath that don't need

var fileMatch = require('file-match');

var filter = fileMatch('*.js');

filter('a.js');            // true
filter('path/a.js');       // false

var filter = fileMatch([
  '**/*',
  '!path/*.js'
  '!img/**/.{jpg,png,gif}'
]);

filter('src/demo.js')           // true
filter('path/demo.js')          // false
filter('path/path/demo.js')     // true
filter('img/demo.png')          // false
filter('img/path/demo.png')     // false

If the filter value is empty string or empty arry, it will always return false, if it's null, will always return true.

Keywords

FAQs

Package last updated on 07 Dec 2014

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc