R8244/node_modules/is-glob14df7e7ba70fsolothurn
README.md
is-glob   
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.
Install
Install with npm:
sh $ npm install --save is-glob
You might also be interested in is-valid-glob and has-glob.
Usage
js var isGlob = require('is-glob');
True
Patterns that have glob characters or regex patterns will return true:
js isGlob('!foo.js'); isGlob('*.js'); isGlob('**/abc.js'); isGlob('abc/*.js'); isGlob('abc/(aaa|bbb).js'); isGlob('abc/[a-z].js'); isGlob('abc/{a,b}.js'); isGlob('abc/?.js'); //=> true
Extglobs
js isGlob('abc/@(a).js'); isGlob('abc/!(a).js'); isGlob('abc/+(a).js'); isGlob('abc/*(a).js'); isGlob('abc/?(a).js'); //=> true
False
Escaped globs or extglobs return false:
js isGlob('abc/\\@(a).js'); isGlob('abc/\\!(a).js'); isGlob('abc/\\+(a).js'); isGlob('abc/\\*(a).js'); isGlob('abc/\\?(a).js'); isGlob('\\!foo.js'); isGlob('\\*.js'); isGlob('\\*\\*/abc.js'); isGlob('abc/\\*.js'); isGlob('abc/\\(aaa|bbb).js'); isGlob('abc/\\[a-z].js'); isGlob('abc/\\{a,b}.js'); isGlob('abc/\\?.js'); //=> false
Patterns that do not have glob patterns return false:
js isGlob('abc.js'); isGlob('abc/def/ghi.js'); isGlob('foo.js'); isGlob('abc/@.js'); isGlob('abc/+.js'); isGlob(); isGlob(null); //=> false
Arrays are also false (If you want to check if an array has a glob pattern, use has-glob):
js isGlob(['**/*.js']); isGlob(['foo.js']); //=> false
About
Related projects
- assemble: Get the rocks out of your socks! Assemble makes you fast at creating web projects… more | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
- base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like set, get, del and use.")
- update: Be scalable! Update is a new, open source developer framework and CLI for automating updates… more | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.")
- verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
Contributors
Commits | Contributor<br/> | |
---|---|---|
40 | jonschlinkert | |
1 | tuvistavie | |
Building docs
_(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
To generate the readme and API documentation with verb:
sh $ npm install -g verb verb-generate-readme && verb
Running tests
Install dev dependencies:
sh $ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
_This file was generated by verb-generate-readme, v0.1.31, on October 12, 2016._