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
- The repository appears actively maintained as of 2026, with a recent upstream push on 2026-02-03 and a release on 2026-02-03, indicating ongoing responsiveness rather than being dormant.
- Update cadence looks bursty rather than frequent, with the previous major update before 2026 occurring in 2021-08-25, then another major update in 2026-02-03. This suggests occasional major updates with long intervals.
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