p-locate is a small JavaScript utility that searches through an iterable (or async iterable) of values/promises and returns the first item whose resolved value makes a provided tester function return true. It is useful when you need an async equivalent of Array.find, for example finding the first file that exists on disk while testing items in order.
Project status
- Actively maintained: The repository shows a recent upstream push and a tagged update, with v7.0.0 dated 2026-02-03 (about 4 months before today, 2026-06-09).
- Update cadence: Major updates have been infrequent overall (for example, v6.0.0 in 2021, v7.0.0 in 2026), but there is evidence of recent renewed activity via the 2026 update.
AI summary generated
Recent updates
v7.0.0
v7.0.0 makes Node.js 20 the minimum supported runtime and adds support for passing AsyncIterable inputs to p-locate. The implementation includes a separate code path for AsyncIterable that iterates serially until the tester returns true.
BreakingFeaturesv6.0.0
This release (v6.0.0) updates p-locate to a pure ESM package and raises the supported Node.js versions. The implementation and TypeScript typings were adjusted accordingly, and several dependencies were bumped (notably p-limit).
Breakingv5.0.0
Release v5.0.0 primarily updates runtime requirements to Node.js 10+ and changes how TypeScript users should import p-locate (CommonJS-style). The code diff also shows a runtime change to module exports and several dependency/tooling upgrades, which are not fully covered by the release notes.
Breakingv4.1.0
v4.1.0 updates the TypeScript definitions to be CommonJS-friendly and adjusts module interop behavior. It also bumps a few dependencies and switches the TypeScript type-test runner from tsd-check to tsd.
v4.0.0
This release (v4.0.0) introduces a requirement to run on Node.js 8 and adds TypeScript type definitions. It is a breaking change for users still on older Node.js versions, but otherwise the release notes are minimal and do not mention other behavior changes.
BreakingFeatures