Gathering detailed insights and metrics for is-glob
Gathering detailed insights and metrics for is-glob
Gathering detailed insights and metrics for is-glob
Gathering detailed insights and metrics for is-glob
is-extglob
Returns true if a string has an extglob.
is-negated-glob
Returns an object with a `negated` boolean and the `!` stripped from negation patterns. Also respects extglobs.
is-valid-glob
Return true if a value is a valid glob pattern.
@types/is-glob
TypeScript definitions for is-glob
If you use globs, this will make your code faster. Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. 55+ million downloads.
npm install is-glob
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
100
Quality
79.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
15,945,544,676
Last Day
14,097,597
Last Week
76,846,126
Last Month
305,585,405
Last Year
3,260,811,895
MIT License
93 Stars
68 Commits
9 Forks
6 Watchers
2 Branches
9 Contributors
Updated on Apr 30, 2025
Minified
Minified + Gzipped
Latest Version
4.0.3
Package Id
is-glob@4.0.3
Size
4.16 kB
NPM Version
7.24.1
Node Version
14.18.0
Published on
Sep 29, 2021
Cumulative downloads
Total Downloads
Last Day
14%
14,097,597
Compared to previous day
Last Week
12.3%
76,846,126
Compared to previous week
Last Month
0.4%
305,585,405
Compared to previous month
Last Year
8.6%
3,260,811,895
Compared to previous year
1
2
Returns
true
if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm:
1$ npm install --save is-glob
You might also be interested in is-valid-glob and has-glob.
1var isGlob = require('is-glob');
True
Patterns that have glob characters or regex patterns will return true
:
1isGlob('!foo.js'); 2isGlob('*.js'); 3isGlob('**/abc.js'); 4isGlob('abc/*.js'); 5isGlob('abc/(aaa|bbb).js'); 6isGlob('abc/[a-z].js'); 7isGlob('abc/{a,b}.js'); 8//=> true
Extglobs
1isGlob('abc/@(a).js'); 2isGlob('abc/!(a).js'); 3isGlob('abc/+(a).js'); 4isGlob('abc/*(a).js'); 5isGlob('abc/?(a).js'); 6//=> true
False
Escaped globs or extglobs return false
:
1isGlob('abc/\\@(a).js'); 2isGlob('abc/\\!(a).js'); 3isGlob('abc/\\+(a).js'); 4isGlob('abc/\\*(a).js'); 5isGlob('abc/\\?(a).js'); 6isGlob('\\!foo.js'); 7isGlob('\\*.js'); 8isGlob('\\*\\*/abc.js'); 9isGlob('abc/\\*.js'); 10isGlob('abc/\\(aaa|bbb).js'); 11isGlob('abc/\\[a-z].js'); 12isGlob('abc/\\{a,b}.js'); 13//=> false
Patterns that do not have glob patterns return false
:
1isGlob('abc.js'); 2isGlob('abc/def/ghi.js'); 3isGlob('foo.js'); 4isGlob('abc/@.js'); 5isGlob('abc/+.js'); 6isGlob('abc/?.js'); 7isGlob(); 8isGlob(null); 9//=> false
Arrays are also false
(If you want to check if an array has a glob pattern, use has-glob):
1isGlob(['**/*.js']); 2isGlob(['foo.js']); 3//=> false
When options.strict === false
the behavior is less strict in determining if a pattern is a glob. Meaning that
some patterns that would return false
may return true
. This is done so that matching libraries like micromatch have a chance at determining if the pattern is a glob or not.
True
Patterns that have glob characters or regex patterns will return true
:
1isGlob('!foo.js', {strict: false});
2isGlob('*.js', {strict: false});
3isGlob('**/abc.js', {strict: false});
4isGlob('abc/*.js', {strict: false});
5isGlob('abc/(aaa|bbb).js', {strict: false});
6isGlob('abc/[a-z].js', {strict: false});
7isGlob('abc/{a,b}.js', {strict: false});
8//=> true
Extglobs
1isGlob('abc/@(a).js', {strict: false}); 2isGlob('abc/!(a).js', {strict: false}); 3isGlob('abc/+(a).js', {strict: false}); 4isGlob('abc/*(a).js', {strict: false}); 5isGlob('abc/?(a).js', {strict: false}); 6//=> true
False
Escaped globs or extglobs return false
:
1isGlob('\\!foo.js', {strict: false});
2isGlob('\\*.js', {strict: false});
3isGlob('\\*\\*/abc.js', {strict: false});
4isGlob('abc/\\*.js', {strict: false});
5isGlob('abc/\\(aaa|bbb).js', {strict: false});
6isGlob('abc/\\[a-z].js', {strict: false});
7isGlob('abc/\\{a,b}.js', {strict: false});
8//=> false
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
Commits | Contributor |
---|---|
47 | jonschlinkert |
5 | doowb |
1 | phated |
1 | danhper |
1 | paulmillr |
Jon Schlinkert
Copyright © 2019, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on March 27, 2019.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 3/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
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