</>PackageGraphPackageGraph

locate-path

npmv8.0.0TypeScript

Get the first path that exists on disk of multiple paths

Safe to adopt

Yes — locate-path scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 359 days ago.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • BMaintenance: grade B, Good.

    Last published 359 days ago.

  • AWeight: grade A, Excellent.

    Pulls in 3 transitive packages, about 30 KB installed (at least — some of the tree is still being crawled).

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding locate-path to a project.

1
Direct dependencies

Runtime packages this one declares itself.

3
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

30 KB
Install size

Unpacked size of this package plus its entire runtime tree.

3
Tree depth

Longest resolved dependency chain below this package.

Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.

Licenses in the dependency tree

MIT

Every license you inherit by installing locate-path, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node >=20
Module format
ESM only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the locate-path README.

import {locatePath} from 'locate-path';

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

console.log(await locatePath(files));
//=> 'rainbow.png'

locate-path vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
locate-paththis page01MIT11 months ago
p-locate216.9M1MIT1 day ago
find-up04MIT1 day ago
pkg-dirdeprecated01MIT1 day ago
find-up-simple02MIT1 day ago
edge-paths01MIT1 day ago

Dependencies

Declared by locate-path v8.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Runtime (1)

Dev (3)

ava ^6.4.1tsd ^0.33.0xo ^1.2.2

Used by

Popular packages that depend on locate-path.

Relationship graph

Dependencies (left) and dependents (right) of locate-path.

p-locatefind-uplocate-path
locate-path dependencies dependents

Frequently installed together

Release history

1 release in the last two years, typically about 248 days apart.

Recent versions of locate-path
VersionPublishedSizeLicense
8.0.0latest11 months ago7.0 KBMIT
7.2.03 years ago7.1 KBMIT
7.1.14 years ago7.0 KBMIT
7.1.04 years ago7.0 KBMIT
7.0.05 years ago6.8 KBMIT
6.0.06 years ago6.9 KBMIT
5.0.07 years ago6.4 KBMIT
4.0.07 years ago5.1 KBMIT
3.0.08 years ago3.8 KBMIT
2.0.09 years agoMIT
1.1.09 years agoMIT
1.0.09 years agoMIT

Overview

locate-path is an npm package that get the first path that exists on disk of multiple paths. It has 1 known dependents in the graph. The latest version is 8.0.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need get the first path that exists on disk of multiple paths and value a focused solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Funding

Frequently asked questions

Should I use locate-path?

Yes — locate-path scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 359 days ago.

How do I install locate-path?

Run `npm install locate-path` to add locate-path to your npm project.

How many dependencies does locate-path have?

locate-path declares 4 direct dependencies and pulls in 3 packages in total once its runtime tree is resolved totalling about 30 KB on disk.

What license is locate-path released under?

locate-path is distributed under the MIT license.

How popular is locate-path?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on locate-path.

Is locate-path still maintained?

The most recent release of locate-path (v8.0.0) was published 11 months ago.

Does locate-path run install scripts?

No. locate-path does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.