{"id":16735675,"url":"https://github.com/micromatch/is-glob","last_synced_at":"2025-04-12T19:42:53.536Z","repository":{"id":24766201,"uuid":"28179425","full_name":"micromatch/is-glob","owner":"micromatch","description":"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. ","archived":false,"fork":false,"pushed_at":"2022-12-29T12:56:43.000Z","size":52,"stargazers_count":92,"open_issues_count":2,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T22:08:55.588Z","etag":null,"topics":["glob","glob-pattern","globbing","javascript","jonschlinkert","match","matching","node","node-glob","nodejs","regex","regexp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micromatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-18T10:41:58.000Z","updated_at":"2025-03-10T01:52:48.000Z","dependencies_parsed_at":"2023-01-14T01:34:51.250Z","dependency_job_id":null,"html_url":"https://github.com/micromatch/is-glob","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fis-glob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fis-glob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fis-glob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fis-glob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micromatch","download_url":"https://codeload.github.com/micromatch/is-glob/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401924,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["glob","glob-pattern","globbing","javascript","jonschlinkert","match","matching","node","node-glob","nodejs","regex","regexp"],"created_at":"2024-10-13T00:06:53.161Z","updated_at":"2025-04-12T19:42:53.510Z","avatar_url":"https://github.com/micromatch.png","language":"JavaScript","readme":"# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions)\n\n\u003e 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.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save is-glob\n```\n\nYou might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob).\n\n## Usage\n\n```js\nvar isGlob = require('is-glob');\n```\n\n### Default behavior\n\n**True**\n\nPatterns that have glob characters or regex patterns will return `true`:\n\n```js\nisGlob('!foo.js');\nisGlob('*.js');\nisGlob('**/abc.js');\nisGlob('abc/*.js');\nisGlob('abc/(aaa|bbb).js');\nisGlob('abc/[a-z].js');\nisGlob('abc/{a,b}.js');\n//=\u003e true\n```\n\nExtglobs\n\n```js\nisGlob('abc/@(a).js');\nisGlob('abc/!(a).js');\nisGlob('abc/+(a).js');\nisGlob('abc/*(a).js');\nisGlob('abc/?(a).js');\n//=\u003e true\n```\n\n**False**\n\nEscaped globs or extglobs return `false`:\n\n```js\nisGlob('abc/\\\\@(a).js');\nisGlob('abc/\\\\!(a).js');\nisGlob('abc/\\\\+(a).js');\nisGlob('abc/\\\\*(a).js');\nisGlob('abc/\\\\?(a).js');\nisGlob('\\\\!foo.js');\nisGlob('\\\\*.js');\nisGlob('\\\\*\\\\*/abc.js');\nisGlob('abc/\\\\*.js');\nisGlob('abc/\\\\(aaa|bbb).js');\nisGlob('abc/\\\\[a-z].js');\nisGlob('abc/\\\\{a,b}.js');\n//=\u003e false\n```\n\nPatterns that do not have glob patterns return `false`:\n\n```js\nisGlob('abc.js');\nisGlob('abc/def/ghi.js');\nisGlob('foo.js');\nisGlob('abc/@.js');\nisGlob('abc/+.js');\nisGlob('abc/?.js');\nisGlob();\nisGlob(null);\n//=\u003e false\n```\n\nArrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)):\n\n```js\nisGlob(['**/*.js']);\nisGlob(['foo.js']);\n//=\u003e false\n```\n\n### Option strict\n\nWhen `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that\nsome patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not.\n\n**True**\n\nPatterns that have glob characters or regex patterns will return `true`:\n\n```js\nisGlob('!foo.js', {strict: false});\nisGlob('*.js', {strict: false});\nisGlob('**/abc.js', {strict: false});\nisGlob('abc/*.js', {strict: false});\nisGlob('abc/(aaa|bbb).js', {strict: false});\nisGlob('abc/[a-z].js', {strict: false});\nisGlob('abc/{a,b}.js', {strict: false});\n//=\u003e true\n```\n\nExtglobs\n\n```js\nisGlob('abc/@(a).js', {strict: false});\nisGlob('abc/!(a).js', {strict: false});\nisGlob('abc/+(a).js', {strict: false});\nisGlob('abc/*(a).js', {strict: false});\nisGlob('abc/?(a).js', {strict: false});\n//=\u003e true\n```\n\n**False**\n\nEscaped globs or extglobs return `false`:\n\n```js\nisGlob('\\\\!foo.js', {strict: false});\nisGlob('\\\\*.js', {strict: false});\nisGlob('\\\\*\\\\*/abc.js', {strict: false});\nisGlob('abc/\\\\*.js', {strict: false});\nisGlob('abc/\\\\(aaa|bbb).js', {strict: false});\nisGlob('abc/\\\\[a-z].js', {strict: false});\nisGlob('abc/\\\\{a,b}.js', {strict: false});\n//=\u003e false\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [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\")\n* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base \"Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks\")\n* [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.\")\n* [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.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 47 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 5  | [doowb](https://github.com/doowb) |  \n| 1  | [phated](https://github.com/phated) |  \n| 1  | [danhper](https://github.com/danhper) |  \n| 1  | [paulmillr](https://github.com/paulmillr) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromatch%2Fis-glob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicromatch%2Fis-glob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromatch%2Fis-glob/lists"}