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 ❤️ and support.
Arrays are also false (If you want to check if an array has a glob pattern, use has-glob):
isGlob(['**/*.js']);isGlob(['foo.js']);//=> false
Option strict
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:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running Tests
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:
$ npm install && npm test
Building docs
(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: