Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 20, 2024 via pnpm

find-up 5.0.0

Find a file or directory by walking up parent directories
Package summary
Share
0
issues
1
license
6
MIT
Package created
1 Sep 2015
Version published
11 Aug 2020
Maintainers
1
Total deps
6
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
find-up@5.0.0
locate-path@6.0.0
p-limit@3.1.0
p-locate@5.0.0
path-exists@4.0.0
yocto-queue@0.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of find-up 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
locate-path6.0.02.88 kBMIT
prod
path-exists4.0.02.02 kBMIT
prod

Visualizations

Frequently Asked Questions

What does find-up do?

Find-up is a useful Node.js package that allows you to find a file or directory by walking up parent directories. It provides a flexible and efficient solution to locate files or directories from a given starting path, with a multitude of custom options to enhance search functionality.

How do you use find-up?

To use find-up, first, install the package using npm with the command $ npm install find-up. Once installed, you can import the necessary functions from the find-up module in your JavaScript file. Here are a few examples of how to use find-up:

For finding a file:

import {findUp} from 'find-up';

console.log(await findUp('unicorn.png'));
// Output: '/Users/sindresorhus/unicorn.png'

For finding either one of the listed files (returns the first one found):

console.log(await findUp(['rainbow.png', 'unicorn.png']));
// Output: '/Users/sindresorhus/unicorn.png'

For custom matcher function:

import path from 'node:path';
import {findUp, pathExists} from 'find-up';

console.log(await findUp(async directory => {
	const hasUnicorns = await pathExists(path.join(directory, 'unicorn.png'));
	return hasUnicorns && directory;
}, {type: 'directory'}));
// Output: '/Users/sindresorhus'

The return values of the functions are promises either for the file path if found, or undefined if not found.

Where are the find-up docs?

The detailed documentation for find-up, including all its parameters and options, is available directly in the readme content provided at the GitHub page https://github.com/sindresorhus/find-up. It explains in-detail about all the methods, options, matchers and usage examples.