Find files or directories by walking up parent directories or down descendant directories.
find-up is a Node.js library that helps locate files or directories by traversing the filesystem. It solves the problem of finding configuration files, project roots, or specific assets by searching upward from a starting directory or downward through descendant paths, which is especially useful in nested project structures.
Node.js developers building CLI tools, build scripts, or applications that need to locate files relative to the current working directory, such as finding configuration files in monorepos or project roots.
Developers choose find-up for its reliable, performant, and flexible API that handles complex filesystem traversal with minimal code. It's widely adopted in the Node.js ecosystem and maintained by a trusted open-source author.
Find a file or directory by walking up parent directories
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports both upward traversal with findUp and downward with findDown, as shown in the README's usage examples for locating files in parent or descendant directories.
Allows searching by filename, array of names, or custom matcher functions, enabling advanced use cases like conditional matching based on file permissions or patterns.
Offers findUpMultiple with limit options and search control via stopAt, depth, and strategy parameters, providing fine-grained management over traversal behavior.
Provides both promise-based async and synchronous versions, as detailed in the API section, catering to different workflow needs in Node.js scripts.
Only works within Node.js environments, limiting cross-platform utility for projects targeting browsers, Deno, or other runtimes without Node.js compatibility.
Lacks native support for glob patterns or regex; users must implement custom matcher functions for advanced pattern matching, adding complexity compared to libraries like glob.
Deep directory searches can be inefficient without optimization, though the findUpStop symbol is provided as a performance workaround, indicating inherent traversal costs.