is-glob
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
is-extglob | 2.1.1 | 2.6 kB | MIT | prod |
"Is-glob" is a JavaScript npm package that returns 'true' if the provided string appears to be a glob pattern or an extglob pattern. It allows you to create efficient, high-performance code by only utilizing external modules like node-glob when it's necessary, leading to quicker code execution and initialization time, improving the overall user experience.
To use "is-glob" in your code, you must first install it using npm by typing npm install --save is-glob
in your terminal. After installation, require 'is-glob' at the top of your JavaScript file like so: var isGlob = require('is-glob');
. You will then be able to test strings to see if they are glob patterns. For example, isGlob('*.js');
will return true, while something like isGlob('abc.js');
will return false, as it is not a glob pattern. "Is-glob" also accepts an optional settings object with a strict boolean, which when set to false, alters the behavior of the function to be less strict in its determination.
var isGlob = require('is-glob');
// example usages
isGlob('*.js'); // returns true
isGlob('abc/*.js'); // returns true
isGlob('abc.js'); // returns false
isGlob('foo.js'); // returns false
isGlob('!foo.js', {strict: false}); // returns true, because `{strict: false}` makes detection less strict
Documentation for "is-glob" can primarily be found in the readme file on the package's GitHub repository: https://github.com/micromatch/is-glob
The readme contains clear instructions for installing and using the package, as well as examples of glob patterns that will return true or false. It also outlines the structure and behavior of the program and provides links to related projects and contributors. If you need more information about the package's methods and APIs, you might also want to delve into the source code itself or the unit tests, both of which are hosted on the GitHub repo.