Gathering detailed insights and metrics for gulp-custom-filter
Gathering detailed insights and metrics for gulp-custom-filter
Gathering detailed insights and metrics for gulp-custom-filter
Gathering detailed insights and metrics for gulp-custom-filter
npm install gulp-custom-filter
Typescript
Module System
Node Version
NPM Version
71.2
Supply Chain
97
Quality
73.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
91 Commits
2 Watchers
3 Branches
1 Contributors
Updated on Sep 07, 2023
Latest Version
0.4.4
Package Id
gulp-custom-filter@0.4.4
Unpacked Size
24.79 kB
Size
7.46 kB
File Count
20
NPM Version
6.14.15
Node Version
14.18.2
Published on
Mar 09, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A gulp plugin to filter files by customized filters.
1$ npm install --save-dev gulp-custom-filter
1var filter = require('gulp-custom-filter'); 2var gulp = require('gulp'); 3var less = require('gulp-less'); 4 5function myFilter(file) { 6 return file.basename.startsWith('my_'); 7} 8 9gulp.task('less', function() { 10 return gulp.src('./less/**/*.less') 11 .pipe(filter(myFilter)) 12 .pipe(less()) 13 .pipe(gulp.dest('./css') 14});
This is equivalent to:
1var filter = require('gulp-custom-filter'); 2var gulp = require('gulp'); 3var less = require('gulp-less'); 4 5gulp.task('less', function() { 6 return gulp.src('./less/**/my_*.less') 7 .pipe(less()) 8 .pipe(gulp.dest('./css') 9});
You may set any predicate function to a vinyl file.
Nagates filter conditions
1var not = filter.not; 2 3gulp.src('./less/**/*.less') 4 .pipe(filter(not(myFilter)) // will pass files which not satisfy myFilter
This filter passes less files which its name does not start with 'my_'.
Passes files which satisfy every filter conditions.
1var and = filter.and; 2 3gulp.src('./less/**/*.less') 4 .pipe(filter(and(myFilter1, myFilter2)) // will pass files which satisfy myFilter1 and myFilter2
Passes files which satisfy at least one of the filter conditions.
1var or = filter.or; 2 3gulp.src('./less/**/*.less') 4 .pipe(filter(or(myFilter1, myFilter2)) // will pass files which satisfy myFilter1 or myFilter2
Passes every files. This is equivalent function() { return true; }
1var all = filter.all; 2 3gulp.src('./less/**/*.less') 4 .pipe(filter(all())) // no file will be filtered out.
Passes no file. This is equivalent function() { return false; }
1var none = filter.none; 2 3gulp.src('./less/**/*.less') 4 .pipe(filter(none())) // no file will be passed.
Glob pattern filter for file name. Just a wrapper of minimatch.
1var glob = filter.glob; 2 3gulp.src('./**/*.*') 4 .pipe(filter(glob('./**/*.less'))).
pattern
: a string or an array of glob pattern.options
: optional options.Ignore list filter.
1var ignore = filter.ignore; 2 3gulp.src('./**/*.*') 4 .pipe(filter(ignore('.gitignore')))
filename
: filename to ignore file.gulp-custom-filter
accepts three type of predicate functions.
A predicate must have one or two argument(s).
It returns a boolean value true
/false
.
1gulp.src('./**/*.*') 2 .pipe(filter(function(file, encode) { 3 return file.isBuffer(); 4 });
To fail the predicate, just throw an error.
1gulp.src('./**/*.*') 2 .pipe(filter(function(file, encode) { 3 throw new Error('error'); 4 });
A predicate must have three arguments. The third argument is a callback function to settle a result.
Call done
with the second argument of true
/false
.
1gulp.src('./**/*.*') 2 .pipe(filter(function(file, encode, done) { 3 setTimeout(function() { 4 done(null, file.isBuffer()); // 1st argument must be falsy. 5 }, 0); 6 });
To fail the predicate, call done
with the first argument of non-falsy value.
1gulp.src('./**/*.*') 2 .pipe(filter(function(file, encode, done) { 3 setTimeout(function() { 4 done(new Error('error')); 5 }, 0); 6 });
A predicate must have one or two argument(s).
It returns a fulfilling promise of boolean value true
/false
.
1gulp.src('./**/*.*') 2 .pipe(filter(function(file, encode) { 3 return Promise.resolve(file.isBuffer()); 4 });
To fail the predicate, return a rejecting promise.
1gulp.src('./**/*.*') 2 .pipe(filter(function(file, encode) { 3 return Promise.reject(new Error('error')); 4 });
v0.4.4
v0.4.3
v0.3.0
v0.2.5
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More