</>PackageGraphPackageGraph

p-locate

npmv7.0.0TypeScript

Get the first fulfilled promise that satisfies the provided testing function

Safe to adopt

Yes — p-locate scores well across adoption, maintenance, weight, supply chain, and licensing. 216.9M downloads per week and 1 known dependents. Last published 218 days ago.

  • AAdoption: grade A, Excellent.

    216.9M downloads per week and 1 known dependents.

  • BMaintenance: grade B, Good.

    Last published 218 days ago.

  • AWeight: grade A, Excellent.

    Pulls in 2 transitive packages, about 23 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 p-locate to a project.

1
Direct dependencies

Runtime packages this one declares itself.

2
Total installed

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

23 KB
Install size

Unpacked size of this package plus its entire runtime tree.

2
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 p-locate, 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 p-locate README.

import {pathExists} from 'path-exists';
import pLocate from 'p-locate';

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

const foundPath = await pLocate(files, file => pathExists(file));

console.log(foundPath);
//=> 'rainbow.png'

p-locate vs the alternatives

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

PackageWeekly downloadsDependentsLicenseLast release
p-locatethis page216.9M1MIT7 months ago
p-map01MIT1 day ago
locate-path01MIT1 day ago
p-limit293.1M5MIT1 day ago
cross-fetch32.9M2MIT1 day ago
es-get-iterator01MIT1 day ago

Dependencies

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

Runtime (1)

Dev (6)

ava ^6.4.1delay ^7.0.0in-range ^3.0.0time-span ^5.1.0tsd ^0.33.0xo ^1.2.3

Used by

Popular packages that depend on p-locate.

Relationship graph

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

p-limitlocate-pathp-locate
p-locate dependencies dependents

Release history

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

Recent versions of p-locate
VersionPublishedSizeLicense
7.0.0latest7 months ago8.0 KBMIT
6.0.05 years ago6.9 KBMIT
5.0.06 years ago7.1 KBMIT
4.1.07 years ago7.1 KBMIT
4.0.07 years ago6.3 KBMIT
3.0.08 years ago4.9 KBMIT
2.0.09 years agoMIT
1.0.09 years agoMIT

Overview

p-locate is an npm package that get the first fulfilled promise that satisfies the provided testing function. It is extremely widely used, with about 216.9M downloads per week and 1 known dependents in the graph. The latest version is 7.0.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need get the first fulfilled promise that satisfies the provided testing function and value a battle-tested, widely-adopted 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

  • Large, well-established user base (216.9M weekly downloads).
  • 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 p-locate?

Yes — p-locate scores well across adoption, maintenance, weight, supply chain, and licensing. 216.9M downloads per week and 1 known dependents. Last published 218 days ago.

How do I install p-locate?

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

How many dependencies does p-locate have?

p-locate declares 7 direct dependencies and pulls in 2 packages in total once its runtime tree is resolved totalling about 23 KB on disk.

What license is p-locate released under?

p-locate is distributed under the MIT license.

How popular is p-locate?

p-locate has approximately 216,902,418 downloads per week and 1 known dependent packages.

Is p-locate still maintained?

The most recent release of p-locate (v7.0.0) was published 7 months ago.

Does p-locate run install scripts?

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