{"id":24892726,"url":"https://github.com/danielbayley/matchup","last_synced_at":"2026-05-11T02:02:21.421Z","repository":{"id":274691814,"uuid":"922732890","full_name":"danielbayley/matchup","owner":"danielbayley","description":"Find the first path matching a glob pattern, walking up from a given directory.","archived":false,"fork":false,"pushed_at":"2025-06-03T11:44:41.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T05:50:53.781Z","etag":null,"topics":["config","configuration","filesystem","find","find-up","fs","glob","glob-pattern","node","nodejs","npm","npm-module","npm-package","npmjs","path","pathfinding","pattern-matching"],"latest_commit_sha":null,"homepage":"https://npm.im/@danielbayley/matchup","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/danielbayley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null},"funding":{"github":"danielbayley","polar":"danielbayley","open_collective":"danielbayley","thanks_dev":"danielbayley","issuehunt":"danielbayley","custom":["https://paypal.me/danieljbayley","https://blockchain.com/btc/address/37rdZq4muDVNJh6jCr4XDXf8X2EFKjL3QQ","https://blockchain.com/eth/address/0x6248B4349e633969376dA20F9C8577530062BE64"]}},"created_at":"2025-01-27T00:08:47.000Z","updated_at":"2025-06-03T11:44:42.000Z","dependencies_parsed_at":"2025-01-31T13:19:32.985Z","dependency_job_id":"d4a93831-d6c2-416e-b801-268e557d64e7","html_url":"https://github.com/danielbayley/matchup","commit_stats":null,"previous_names":["danielbayley/match-up","danielbayley/matchup"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/danielbayley/matchup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbayley%2Fmatchup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbayley%2Fmatchup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbayley%2Fmatchup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbayley%2Fmatchup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielbayley","download_url":"https://codeload.github.com/danielbayley/matchup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbayley%2Fmatchup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262862288,"owners_count":23376400,"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":["config","configuration","filesystem","find","find-up","fs","glob","glob-pattern","node","nodejs","npm","npm-module","npm-package","npmjs","path","pathfinding","pattern-matching"],"created_at":"2025-02-01T18:16:28.413Z","updated_at":"2026-05-11T02:02:16.381Z","avatar_url":"https://github.com/danielbayley.png","language":"JavaScript","funding_links":["https://github.com/sponsors/danielbayley","https://polar.sh/danielbayley","https://opencollective.com/danielbayley","https://thanks.dev/danielbayley","https://issuehunt.io/r/danielbayley","https://paypal.me/danieljbayley","https://blockchain.com/btc/address/37rdZq4muDVNJh6jCr4XDXf8X2EFKjL3QQ","https://blockchain.com/eth/address/0x6248B4349e633969376dA20F9C8577530062BE64"],"categories":[],"sub_categories":[],"readme":"\u003cimg title=\"Matchup\" alt=\"mu\" src=\"logo.svg\" align=\"right\" width=\"160vw\"/\u003e\n\u003cbr\u003e\u003cbr\u003e\n\nMatchup\n=======\nFind the first path matching a [_glob_ pattern], walking up from a given directory.\n\n## Example\n~~~ js\nimport fs from \"node:fs/promises\"\nimport {matchup} from \"@danielbayley/matchup\"\n\nconst cwd = import.meta.dirname\nconst metadata = await matchup(\"package.*\", { cwd }) // package.json\n  .then(fs.readFile)\n  .then(JSON.parse)\n  .catch(console.error)\n\nconsole.log(metadata.type) // module\n~~~\n\nOptions\n------------------------------------------------------------------------------------\n| Option     | Default                 | Description                               |\n|:-----------|:------------------------|:------------------------------------------|\n| `cwd`      | [`import.meta.dirname`] | Search starting point.                    |\n| `ignore`   | `[\"node_modules\"]`      | `ignore` paths containing these patterns. |\n| `parse`    |                         | `return` a [`node:path`] object.          |\n| `max`      | `10`                    | Maximum upward traversal depth.           |\n| `symlinks` |                         | `false` will not match [symbolic links].  |\n\n## Install\n~~~ sh\npnpm install @danielbayley/matchup\n~~~\n\u003e [!IMPORTANT]\n\u003e This package is _[ESM]_ [only], so must be [`import`]ed instead of [`require`]d,\n\u003e and [depends] on [_Node_.js] [`\u003e=`][][`20`].\n\nSpecify this requirement with [`engines`] and/or [`devEngines`]:\n~~~ jsonc\n// package.json\n\"type\": \"module\",\n\"engines\": {\n  \"node\": \"\u003e=20\"\n},\n\"devEngines\": {\n  \"runtime\": {\n    \"name\": \"node\",\n    \"version\": \"\u003e=20\"\n  }\n},\n~~~\n\nLicense\n-------\n[MIT] © [Daniel Bayley]\n\n[MIT]:                    LICENSE.md\n[Daniel Bayley]:          https://github.com/danielbayley\n\n[_Node_.js]:              https://nodejs.org\n[ESM]:                    https://developer.mozilla.org/docs/Web/JavaScript/Guide/Modules\n[only]:                   https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n[`import`]:               https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import\n[`require`]:              https://nodejs.org/api/modules.html#requireid\n[depends]:                https://docs.npmjs.com/cli/v11/configuring-npm/package-json#engines\n[`\u003e=`]:                   https://docs.npmjs.com/cli/v6/using-npm/semver#ranges\n[`20`]:                   https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md\n[`engines`]:              https://docs.npmjs.com/cli/v11/configuring-npm/package-json#engines\n[`devEngines`]:           https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines\n\n[_glob_ pattern]:         https://globster.xyz\n[`import.meta.dirname`]:  https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import.meta\n[`node:path`]:            https://nodejs.org/api/path.html#pathparsepath\n[symbolic links]:         https://wikipedia.org/wiki/Symbolic_link\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielbayley%2Fmatchup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielbayley%2Fmatchup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielbayley%2Fmatchup/lists"}