{"id":15655174,"url":"https://github.com/jonschlinkert/matched","last_synced_at":"2025-04-14T12:34:46.604Z","repository":{"id":16649237,"uuid":"19404631","full_name":"jonschlinkert/matched","owner":"jonschlinkert","description":"Glob matching with support for multiple patterns and negation. Use `~` in cwd to find files in user home, or `@` for global npm modules.","archived":false,"fork":false,"pushed_at":"2020-11-02T15:15:11.000Z","size":101,"stargazers_count":26,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T01:50:49.032Z","etag":null,"topics":["file-system","files","find","fs","glob","glob-matching","glob-pattern","globby","pattern","search","wildcard"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","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/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jonschlinkert","tidelift":"npm/matched"}},"created_at":"2014-05-03T14:23:12.000Z","updated_at":"2024-12-23T23:52:16.000Z","dependencies_parsed_at":"2022-09-26T21:11:05.267Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/matched","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fmatched","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fmatched/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fmatched/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fmatched/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/matched/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248882042,"owners_count":21176964,"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":["file-system","files","find","fs","glob","glob-matching","glob-pattern","globby","pattern","search","wildcard"],"created_at":"2024-10-03T12:56:49.806Z","updated_at":"2025-04-14T12:34:46.575Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jonschlinkert","https://tidelift.com/funding/github/npm/matched","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=W8YFZ425KND68"],"categories":[],"sub_categories":[],"readme":"# matched [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/matched.svg?style=flat)](https://www.npmjs.com/package/matched) [![NPM monthly downloads](https://img.shields.io/npm/dm/matched.svg?style=flat)](https://npmjs.org/package/matched) [![NPM total downloads](https://img.shields.io/npm/dt/matched.svg?style=flat)](https://npmjs.org/package/matched) [![Build Status](https://travis-ci.org/jonschlinkert/matched.svg?branch=master)](https://travis-ci.org/jonschlinkert/matched)\n\n\u003e Adds array support to node-glob, sync and async. Also supports tilde expansion (user home) and resolving to global npm modules.\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/) (requires [Node.js](https://nodejs.org/en/) \u003e=10):\n\n```sh\n$ npm install --save matched\n```\n\n## Usage\n\n```js\nconst glob = require('matched');\n// async signature\nglob(patterns[, options]);\n\n// sync signature\nglob.sync(patterns[, options]);\n```\n\n* `patterns` (string|array) - one or more glob patterns\n* `options` - options to pass to [node-glob](https://github.com/isaacs/node-glob);\n\n_Also note that if non-glob file paths are passed, only paths that exist on the file system will be returned._\n\n**promise**\n\n```js\nglob(['*.txt'])\n  .then(files =\u003e console.log(files)) //=\u003e ['a.txt', 'b.txt', 'c.txt']\n  .catch(console.error)\n\n// or with async-await\n(async() =\u003e {\n  const files = await glob('*.txt');\n  console.log(files);\n  //=\u003e ['foo.txt', 'bar.txt']\n})();\n```\n\n**callback**\n\n```js\nglob(['*.js'], (err, files) =\u003e {\n  console.log(files);\n  //=\u003e ['utils.js', 'index.js']\n});\n```\n\n**sync**\n\n```js\nconst files = glob.sync(['*.js']);\n//=\u003e ['utils.js', 'index.js']\n```\n\n**options**\n\nAll methods take an options object to be forwarded to [node-glob](https://github.com/isaacs/node-glob) as the second argument.\n\n```js\nconst files = glob(['*.js'], { cwd: 'test' });\nconsole.log(files);\n//=\u003e ['test.js']\n```\n\n## v4.1\n\n* Adds support for `options.onMatch()` which is passed to [node-glob](https://github.com/isaacs/node-glob) as a listener for the `match` event.\n* Adds support for `options.onFiles()` to allow the user to get the files returned by each glob pattern.\n* Small optimizations in logic for handling non-glob patterns that are passed for matching literal file names.\n\n## v4.0\n\n* Use [picomatch](https://github.com/micromatch/picomatch) for parsing glob patterns.\n\n## v3.0\n\n* Removes `cache` property from results array.\n* Optimizations\n\n## v0.4.1\n\n* Exposes a non-enumerable `cache` property on the returned files array. This is a patch release since the property does not change the existing API and should not otherwise effect behavior or results.\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* [findup-sync](https://www.npmjs.com/package/findup-sync): Find the first file matching a given pattern in the current directory or the nearest… [more](https://github.com/gulpjs/findup-sync#readme) | [homepage](https://github.com/gulpjs/findup-sync#readme \"Find the first file matching a given pattern in the current directory or the nearest ancestor directory.\")\n* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/micromatch/is-glob) | [homepage](https://github.com/micromatch/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 bet\")\n* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch \"Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 73 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 8  | [TrySound](https://github.com/TrySound) |  \n| 1  | [sindresorhus](https://github.com/sindresorhus) |  \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 © 2020, [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 January 15, 2020._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fmatched","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fmatched","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fmatched/lists"}