Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielbayley/matchup
Find the first path matching a glob pattern, walking up from a given directory.
https://github.com/danielbayley/matchup
config configuration filesystem find find-up fs glob glob-pattern npm npm-module npm-package path pathfinding pattern-matching
Last synced: 5 days ago
JSON representation
Find the first path matching a glob pattern, walking up from a given directory.
- Host: GitHub
- URL: https://github.com/danielbayley/matchup
- Owner: danielbayley
- License: mit
- Created: 2025-01-27T00:08:47.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2025-01-31T13:14:47.000Z (6 days ago)
- Last Synced: 2025-01-31T13:19:27.355Z (6 days ago)
- Topics: config, configuration, filesystem, find, find-up, fs, glob, glob-pattern, npm, npm-module, npm-package, path, pathfinding, pattern-matching
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Matchup
=======
Find the first path matching a [_glob_ pattern], walking up from a given directory.## Example
~~~ js
import {matchUp} from "@danielbayley/matchup"const metadata = await matchup("package.*", { cwd: import.meta.dirname })
~~~Options
------------------------------------------------------------------------------------
| Option | Default | Description |
|:-----------|:------------------------|:------------------------------------------|
| `cwd` | [`import.meta.dirname`] | Search starting point. |
| `ignore` | `["node_modules"]` | `ignore` paths containing these patterns. |
| `max` | `10` | Maximum upward traversal depth. |
| `symlinks` | | `false` will not match [symbolic links]. |## Install
~~~ sh
pnpm install @danielbayley/match-up
~~~License
-------
[MIT] © [Daniel Bayley][MIT]: LICENSE.md
[Daniel Bayley]: https://github.com/danielbayley[_glob_ pattern]: https://globster.xyz
[`import.meta.dirname`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import.meta
[symbolic links]: https://wikipedia.org/wiki/Symbolic_link