{"id":30267353,"url":"https://github.com/micromatch/bash-match","last_synced_at":"2025-08-15T23:34:33.786Z","repository":{"id":65990485,"uuid":"71099544","full_name":"micromatch/bash-match","owner":"micromatch","description":"Match strings using bash. Does not work on windows, and does not read from the file system. This library requires that Bash 4.3 or higher is installed and is mostly used for checking parity in unit tests.","archived":false,"fork":false,"pushed_at":"2017-04-27T12:44:03.000Z","size":15,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-10T21:07:42.734Z","etag":null,"topics":["bash","file","filepath","glob","javascript","match","node","nodejs","path"],"latest_commit_sha":null,"homepage":null,"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":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["doowb","jonschlinkert"]}},"created_at":"2016-10-17T04:18:11.000Z","updated_at":"2023-11-07T04:09:06.000Z","dependencies_parsed_at":"2023-02-22T18:31:03.819Z","dependency_job_id":null,"html_url":"https://github.com/micromatch/bash-match","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"7374475242822d7b928af9b444968ea1edb14961"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/micromatch/bash-match","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fbash-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fbash-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fbash-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fbash-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micromatch","download_url":"https://codeload.github.com/micromatch/bash-match/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fbash-match/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270178645,"owners_count":24540483,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bash","file","filepath","glob","javascript","match","node","nodejs","path"],"created_at":"2025-08-15T23:34:29.751Z","updated_at":"2025-08-15T23:34:33.768Z","avatar_url":"https://github.com/micromatch.png","language":"JavaScript","funding_links":["https://github.com/sponsors/doowb","https://github.com/sponsors/jonschlinkert"],"categories":[],"sub_categories":[],"readme":"# bash-match [![NPM version](https://img.shields.io/npm/v/bash-match.svg?style=flat)](https://www.npmjs.com/package/bash-match) [![NPM monthly downloads](https://img.shields.io/npm/dm/bash-match.svg?style=flat)](https://npmjs.org/package/bash-match)  [![NPM total downloads](https://img.shields.io/npm/dt/bash-match.svg?style=flat)](https://npmjs.org/package/bash-match) [![Linux Build Status](https://img.shields.io/travis/micromatch/bash-match.svg?style=flat\u0026label=Travis)](https://travis-ci.org/micromatch/bash-match)\n\n\u003e Match strings using bash. Does not work on windows, and does not read from the file system. This library requires that Bash 4.3 or higher is installed and is mostly used for checking parity in unit tests.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save bash-match\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add bash-match\n```\n\n## Usage\n\n```js\nvar readme = require('bash-match');\n```\n\n## API\n\n### [bash](index.js#L30)\n\nReturns true if `str` matches the given `pattern`.\n\n**Params**\n\n* `str` **{String}**\n* `pattern` **{String}**\n* `options` **{Options}**: Set `strictErrors` to true to throw when bash throws an error. Otherwise it just returns false.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\nvar bash = require('bash-match');\nconsole.log(bash('foo', 'f*'));\n//=\u003e true\n\nconsole.log(bash('foo', 'b*'));\n//=\u003e false\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e.isMatch\u003c/strong\u003e\u003c/summary\u003e\n\n### [.isMatch](index.js#L74)\n\nReturns true if `str` matches the given `pattern`. Alias for the [main export](#bash).\n\n**Params**\n\n* `str` **{String}**\n* `pattern` **{String}**\n* `options` **{Options}**: Set `strictErrors` to true to throw when bash throws an error. Otherwise it just returns false.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\nvar bash = require('bash-match');\nconsole.log(bash.isMatch('foo', 'f*'));\n//=\u003e true\n\nconsole.log(bash.isMatch('foo', 'b*'));\n//=\u003e false\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e.match\u003c/strong\u003e\u003c/summary\u003e\n\n### [.match](index.js#L95)\n\nTakes a `list` of strings and a glob `pattern`, and returns an array of strings that match the pattern.\n\n**Params**\n\n* `array` **{Array}**: List of strings to match\n* `pattern` **{String}**: Glob pattern\n* `options` **{Options}**: Set `strictErrors` to true to throw when bash throws an error. Otherwise it just returns false.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\nvar bash = require('bash-match');\nconsole.log(bash.match(['foo', 'bar'], 'b*'));\n//=\u003e ['bar']\n```\n\n\u003c/details\u003e\n\n## About\n\n### Related projects\n\n* [bash-glob](https://www.npmjs.com/package/bash-glob): Bash-powered globbing for node.js | [homepage](https://github.com/jonschlinkert/bash-glob \"Bash-powered globbing for node.js\")\n* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces \"Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.\")\n* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch \"Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.\")\n* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/jonschlinkert/nanomatch) | [homepage](https://github.com/jonschlinkert/nanomatch \"Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\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### Running tests\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### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [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.6.0, on April 27, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromatch%2Fbash-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicromatch%2Fbash-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromatch%2Fbash-match/lists"}