1 # is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-glob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-glob)
3 > 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.
7 Install with [npm](https://www.npmjs.com/):
10 $ npm install --save is-glob
13 You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob).
18 var isGlob = require('is-glob');
23 Patterns that have glob characters or regex patterns will return `true`:
30 isGlob('abc/(aaa|bbb).js');
31 isGlob('abc/[a-z].js');
32 isGlob('abc/{a,b}.js');
40 isGlob('abc/@(a).js');
41 isGlob('abc/!(a).js');
42 isGlob('abc/+(a).js');
43 isGlob('abc/*(a).js');
44 isGlob('abc/?(a).js');
50 Escaped globs or extglobs return `false`:
53 isGlob('abc/\\@(a).js');
54 isGlob('abc/\\!(a).js');
55 isGlob('abc/\\+(a).js');
56 isGlob('abc/\\*(a).js');
57 isGlob('abc/\\?(a).js');
60 isGlob('\\*\\*/abc.js');
62 isGlob('abc/\\(aaa|bbb).js');
63 isGlob('abc/\\[a-z].js');
64 isGlob('abc/\\{a,b}.js');
69 Patterns that do not have glob patterns return `false`:
73 isGlob('abc/def/ghi.js');
82 Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)):
94 * [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [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")
95 * [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [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`.")
96 * [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [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.")
97 * [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [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.")
101 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
105 | **Commits** | **Contributor**<br/> |
107 | 40 | [jonschlinkert](https://github.com/jonschlinkert) |
108 | 1 | [tuvistavie](https://github.com/tuvistavie) |
112 _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
114 To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
117 $ npm install -g verb verb-generate-readme && verb
122 Install dev dependencies:
125 $ npm install -d && npm test
132 * [github/jonschlinkert](https://github.com/jonschlinkert)
133 * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
137 Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
138 Released under the [MIT license](https://github.com/jonschlinkert/is-glob/blob/master/LICENSE).
142 _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._