{"_id":"matcher","_rev":"4252257","name":"matcher","description":"Simple wildcard matching","dist-tags":{"latest":"6.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-03-31T23:56:17.000Z","created":"2016-02-05T07:07:31.574Z","6.0.0":"2025-09-15T19:45:12.142Z","5.0.0":"2021-10-03T09:29:44.079Z","4.0.0":"2021-02-28T10:59:06.276Z","3.0.0":"2020-04-26T16:12:45.930Z","2.1.0":"2019-11-19T05:55:46.578Z","2.0.0":"2019-04-22T07:18:36.241Z","1.1.1":"2018-05-25T03:26:35.128Z","1.1.0":"2018-02-11T08:11:47.911Z","1.0.0":"2017-05-16T16:22:24.715Z","0.1.2":"2016-03-02T15:07:39.686Z","0.1.1":"2016-02-05T08:11:31.898Z","0.1.0":"2016-02-05T07:07:31.574Z"},"users":{"edwardxyt":true,"rocket0191":true,"restuta":true,"jrvldam":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"versions":{"6.0.0":{"name":"matcher","version":"6.0.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava","bench":"matcha bench.js"},"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^5.0.0"},"devDependencies":{"ava":"^6.4.1","matcha":"^0.7.0","xo":"^1.2.2"},"_id":"matcher@6.0.0","gitHead":"03e11aa72334be59532f5252700a9d14208f3ee4","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_nodeVersion":"18.20.4","_npmVersion":"10.9.2","dist":{"shasum":"adb96076a0d045cdd601898395b52891755c0cf8","size":4231,"noattachment":false,"key":"/matcher/-/matcher-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/matcher_6.0.0_1757965511941_0.2798809645501834"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-15T19:45:12.142Z","publish_time":1757965512142,"_source_registry_name":"default","_cnpm_publish_time":1757965512142},"5.0.0":{"name":"matcher","version":"5.0.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd","bench":"matcha bench.js"},"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","matcha":"^0.7.0","tsd":"^0.17.0","xo":"^0.45.0"},"gitHead":"9c9a267dbf6e7e95dcc0d29cf4bd756ea802ab01","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@5.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"shasum":"cd82f1c7ae7ee472a9eeaf8ec7cac45e0fe0da62","size":3900,"noattachment":false,"key":"/matcher/-/matcher-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_5.0.0_1633253383888_0.1259041616871588"},"_hasShrinkwrap":false,"publish_time":1633253384079,"_cnpm_publish_time":1633253384079},"4.0.0":{"name":"matcher","version":"4.0.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd","bench":"matcha bench.js"},"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^4.0.0"},"devDependencies":{"ava":"^2.4.0","matcha":"^0.7.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"1b92d11047336a5c1f55e26ec8518f99d8f1beec","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@4.0.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a42a05a09aaed92e2d241eb91fddac689461ea51","size":3483,"noattachment":false,"key":"/matcher/-/matcher-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-4.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_4.0.0_1614509946111_0.507401972956697"},"_hasShrinkwrap":false,"publish_time":1614509946276,"_cnpm_publish_time":1614509946276},"3.0.0":{"name":"matcher","version":"3.0.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd","bench":"matcha bench.js"},"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^4.0.0"},"devDependencies":{"ava":"^2.4.0","matcha":"^0.7.0","tsd":"^0.11.0","xo":"^0.30.0"},"xo":{"rules":{"@typescript-eslint/member-ordering":"off"}},"gitHead":"d29550d281885df0b32d53c2b72ec788e3265454","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@3.0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bd9060f4c5b70aa8041ccc6f80368760994f30ca","size":3357,"noattachment":false,"key":"/matcher/-/matcher-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_3.0.0_1587917565810_0.7837550944109486"},"_hasShrinkwrap":false,"publish_time":1587917565930,"_cnpm_publish_time":1587917565930},"2.1.0":{"name":"matcher","version":"2.1.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd","bench":"matcha bench.js"},"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^2.0.0"},"devDependencies":{"ava":"^2.4.0","matcha":"^0.7.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"519dbd05c62c9bbaefa00867666b8f5be49d2545","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@2.1.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"64e1041c15b993e23b786f93320a7474bf833c28","size":3261,"noattachment":false,"key":"/matcher/-/matcher-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_2.1.0_1574142946425_0.4085434859242858"},"_hasShrinkwrap":false,"publish_time":1574142946578,"_cnpm_publish_time":1574142946578},"2.0.0":{"name":"matcher","version":"2.0.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd","bench":"matcha bench.js"},"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","matcha":"^0.7.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"c3e9e96abbbff8ea93e5876819d1b4d3929aec5a","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"85fe38d97670dbd2a46590cf099401e2ffb4755c","size":2888,"noattachment":false,"key":"/matcher/-/matcher-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_2.0.0_1555917516083_0.45884867175450017"},"_hasShrinkwrap":false,"publish_time":1555917516241,"_cnpm_publish_time":1555917516241},"1.1.1":{"name":"matcher","version":"1.1.1","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava","bench":"matcha bench.js"},"files":["index.js"],"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^1.0.4"},"devDependencies":{"ava":"*","matcha":"^0.7.0","xo":"*"},"gitHead":"ceb35a277e4531a6c032d16e8f98585855ec1556","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"51d8301e138f840982b338b116bb0c09af62c1c2","size":2545,"noattachment":false,"key":"/matcher/-/matcher-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-1.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_1.1.1_1527218795047_0.685635199476512"},"_hasShrinkwrap":false,"publish_time":1527218795128,"_cnpm_publish_time":1527218795128},"1.1.0":{"name":"matcher","version":"1.1.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava","bench":"matcha bench.js"},"files":["index.js"],"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^1.0.4"},"devDependencies":{"ava":"*","matcha":"^0.7.0","xo":"*"},"gitHead":"42610487ad6679e8198c330a7d0a8532a1d10526","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4ad3a9cb6585186dc95cb8a08c7de936caed17ee","size":2555,"noattachment":false,"key":"/matcher/-/matcher-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matcher_1.1.0_1518336707867_0.22106888789782264"},"_hasShrinkwrap":false,"publish_time":1518336707911,"_cnpm_publish_time":1518336707911},"1.0.0":{"name":"matcher","version":"1.0.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/matcher.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava","bench":"matcha bench.js"},"files":["index.js"],"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globber","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^1.0.4"},"devDependencies":{"ava":"*","matcha":"^0.7.0","xo":"*"},"gitHead":"616bdec80b7052884e5859c7c0f58352b57d8bd7","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher#readme","_id":"matcher@1.0.0","_shasum":"aaf0c4816eb69b92094674175625f3466b0e3e19","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"aaf0c4816eb69b92094674175625f3466b0e3e19","size":2432,"noattachment":false,"key":"/matcher/-/matcher-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/matcher-1.0.0.tgz_1494951741280_0.6750510828569531"},"directories":{},"publish_time":1494951744715,"_hasShrinkwrap":false,"_cnpm_publish_time":1494951744715},"0.1.2":{"name":"matcher","version":"0.1.2","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/matcher"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^1.0.4"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"efa4f8f4857d360c1663caeffd17648c03243454","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher","_id":"matcher@0.1.2","_shasum":"ef20cbde64c24c50cc61af5b83ee0b1b8ff00101","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ef20cbde64c24c50cc61af5b83ee0b1b8ff00101","size":2351,"noattachment":false,"key":"/matcher/-/matcher-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-0.1.2.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/matcher-0.1.2.tgz_1456931259008_0.5133641171269119"},"directories":{},"publish_time":1456931259686,"_cnpm_publish_time":1456931259686,"_hasShrinkwrap":false},"0.1.1":{"name":"matcher","version":"0.1.1","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/matcher"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^1.0.4"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"63379582df6fb1ec483baddadb3d22bd585ad231","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher","_id":"matcher@0.1.1","_shasum":"5693045d2e0777f24661dfce36d1415d91d37d00","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5693045d2e0777f24661dfce36d1415d91d37d00","size":2343,"noattachment":false,"key":"/matcher/-/matcher-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-0.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/matcher-0.1.1.tgz_1454659889764_0.02017889660783112"},"directories":{},"publish_time":1454659891898,"_cnpm_publish_time":1454659891898,"_hasShrinkwrap":false},"0.1.0":{"name":"matcher","version":"0.1.0","description":"Simple wildcard matching","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/matcher"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["matcher","matching","match","regex","regexp","regular","expression","wildcard","pattern","string","filter","glob","globbing","minimatch"],"dependencies":{"escape-string-regexp":"^1.0.4"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"da6184cc6af395de7921cfab82b2df7bd45fc5b0","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"homepage":"https://github.com/sindresorhus/matcher","_id":"matcher@0.1.0","_shasum":"bf35c904f9c612e36b686f38df96dd96a62da651","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bf35c904f9c612e36b686f38df96dd96a62da651","size":2326,"noattachment":false,"key":"/matcher/-/matcher-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/matcher/download/matcher-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/matcher-0.1.0.tgz_1454656050975_0.6321127344854176"},"directories":{},"publish_time":1454656051574,"_cnpm_publish_time":1454656051574,"_hasShrinkwrap":false}},"readme":"# matcher\n\n> Simple [wildcard](https://en.wikipedia.org/wiki/Wildcard_character) matching\n\nUseful when you want to accept loose string input and regexes/globs are too convoluted.\n\n## Install\n\n```sh\nnpm install matcher\n```\n\n## Usage\n\n```js\nimport {matcher, isMatch} from 'matcher';\n\nmatcher(['foo', 'bar', 'moo'], ['*oo', '!foo']);\n//=> ['moo']\n\nmatcher(['foo', 'bar', 'moo'], ['!*oo']);\n//=> ['bar']\n\nmatcher('moo', ['']);\n//=> []\n\nmatcher('moo', []);\n//=> []\n\nmatcher([''], ['']);\n//=> ['']\n\nisMatch('unicorn', 'uni*');\n//=> true\n\nisMatch('unicorn', '*corn');\n//=> true\n\nisMatch('unicorn', 'un*rn');\n//=> true\n\nisMatch('rainbow', '!unicorn');\n//=> true\n\nisMatch('foo bar baz', 'foo b* b*');\n//=> true\n\nisMatch('unicorn', 'uni\\\\*');\n//=> false\n\nisMatch(['foo', 'bar'], 'f*');\n//=> true\n\nisMatch(['foo', 'bar'], ['a*', 'b*']);\n//=> true\n\nisMatch('unicorn', ['']);\n//=> false\n\nisMatch('unicorn', []);\n//=> false\n\nisMatch([], 'bar');\n//=> false\n\nisMatch([], []);\n//=> false\n\nisMatch([''], ['']);\n//=> true\n\n// With `allPatterns` option\nisMatch('foobar', ['foo*', '*bar'], {allPatterns: true});\n//=> true\n\nisMatch('foo', ['foo*', '*bar'], {allPatterns: true});\n//=> false\n```\n\n## API\n\nIt matches even across newlines. For example, `foo*r` will match `foo\\nbar`.\n\n### matcher(inputs, patterns, options?)\n\nAccepts a string or an array of strings for both `inputs` and `patterns`.\n\nReturns an array of `inputs` filtered based on the `patterns`.\n\n### isMatch(inputs, patterns, options?)\n\nAccepts a string or an array of strings for both `inputs` and `patterns`.\n\nReturns a `boolean` of whether any of the given `inputs` matches at least one of the `patterns`.\n\n#### inputs\n\nType: `string | string[]`\n\nThe string or array of strings to match.\n\n#### options\n\nType: `object`\n\n##### caseSensitive\n\nType: `boolean`\\\nDefault: `false`\n\nMake matching case-sensitive. When `false`, treats uppercase and lowercase characters as being the same.\n\nEnsure you use this correctly. For example, files and directories should be matched case-insensitively, while most often, object keys should be matched case-sensitively.\n\n```js\nimport {isMatch} from 'matcher';\n\nisMatch('UNICORN', 'UNI*', {caseSensitive: true});\n//=> true\n\nisMatch('UNICORN', 'unicorn', {caseSensitive: true});\n//=> false\n\nisMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true});\n//=> false\n```\n\n##### allPatterns\n\nType: `boolean`\\\nDefault: `false`\n\nRequire all negated patterns to not match and any normal patterns to match at least once. Otherwise, it will be a no-match condition.\n\n```js\nimport {matcher} from 'matcher';\n\n// Find text strings containing both \"edge\" and \"tiger\" in arbitrary order, but not \"stunt\".\nconst demo = (strings) => matcher(strings, ['*edge*', '*tiger*', '!*stunt*'], {allPatterns: true});\n\ndemo(['Hey, tiger!', 'tiger has edge over hyenas', 'pushing a tiger over the edge is a stunt']);\n//=> ['tiger has edge over hyenas']\n```\n\n```js\nimport {matcher} from 'matcher';\n\nmatcher(['foo', 'for', 'bar'], ['f*', 'b*', '!x*'], {allPatterns: true});\n//=> ['foo', 'for', 'bar']\n\nmatcher(['foo', 'for', 'bar'], ['f*'], {allPatterns: true});\n//=> []\n```\n\n#### patterns\n\nType: `string | string[]`\n\nUse `*` to match zero or more characters.\n\nA leading `!` negates the pattern.\n\nAn input string will be omitted, if it does not match any non-negated patterns present, or if it matches a negated pattern, or if no pattern is present.\n\n## Benchmark\n\n```sh\nnpm run bench\n```\n\n## Related\n\n- [matcher-cli](https://github.com/sindresorhus/matcher-cli) - CLI for this module\n- [multimatch](https://github.com/sindresorhus/multimatch) - Extends `minimatch.match()` with support for multiple patterns\n","_attachments":{},"homepage":"https://github.com/sindresorhus/matcher#readme","bugs":{"url":"https://github.com/sindresorhus/matcher/issues"},"license":"MIT"}