exclusion-manager
v1.0.1
Published
Manages a list of file or directory names (or patterns) to ignore/exclude and provides an easy to way check if a file or directory name should be ignored.
Downloads
13
Maintainers
Readme
Exclusion Manager
Manages a list of file or directory names (or patterns) to ignore/exclude and provides an easy to way check if a file or directory name should be ignored.
npm install exclusion-manager
Usage
When you know the things you want to ignore ahead of time
var ExclusionManager = require('exclusion-manager');
var toIgnore = [
'node_modules',
'bower_components',
'.git',
'vendor',
// Regexes supported too
/.*\.js/,
/.*\.scss/
];
var emanager = new ExclusionManager(toIgnore);
console.log(emanager.shouldIgnore('bundle.js')); // returns true
If you need to add things dynamically
emanager.addExclusion('.jshintrc');
Under the hood
Exclusion manager converts everything to Regular expressions (if they're not already) for more precise matching.