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 30, 2024 via pnpm

locate-path 6.0.0

Get the first path that exists on disk of multiple paths
Package summary
Share
0
issues
1
license
4
MIT
Package created
20 Nov 2016
Version published
10 Aug 2020
Maintainers
1
Total deps
4
Direct deps
1
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
4 Packages, Including:
locate-path@6.0.0
p-limit@3.1.0
p-locate@5.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

1
All Dependencies CSV
β“˜ This is a list of locate-path 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
p-locate5.0.03.08 kBMIT
prod

Visualizations

Frequently Asked Questions

What does locate-path do?

The npm package "locate-path" helps in finding the first path from a given set of paths that exists on the disk. It checks the paths in array order and returns a promise that resolves to a string representing the first path that exists. This makes it extremely useful when dealing with files and directories in a JavaScript project.

How do you use locate-path?

To use "locate-path", first, you need to install the package using npm by running the command npm install locate-path. Once the package has been installed, you can import it into your JavaScript file using the import statement like this: import {locatePath} from 'locate-path';.

Here's a simple usage example of how to use "locate-path":

import {locatePath} from 'locate-path';

const files = [
	'unicorn.png',
	'rainbow.png', // Only this file exists on the disk
	'pony.png'
];

console(await locatePath(files));

In the above example, an array of file paths is given. The locatePath function will check the files in the order they appear in the array, and, since 'rainbow.png' exists on the disk, 'rainbow' will be logged to the console.

Where are the locate-path docs?

The detailed documentation for "locate-path" can be found in its README file on the GitHub repository reachable via this URL: https://github.com/sindresorhus/locate-path.git. The README file explains the package's API, with details like return values, data type requirements, and optional parameters for the package's methods. It also includes usage examples and links to related packages for further assistance. You can refer to the README for more complex examples and further understanding of the package's use cases.