Back to Explore

sindresorhus/p-try

GitHub
3 watchersOpen source

Last release:

p-try starts a promise chain by running a function that may throw, returning a Promise that resolves with the function’s value or rejects if it throws. It’s useful when you want to integrate synchronous, potentially throwing code into async Promise workflows, with optional arguments to avoid unnecessary closures.

Project status

  • Maintenance status: The most recent version update is v3.0.0 on 2021-10-04, which suggests the package has been largely quiet/dormant in terms of published updates, despite an upstream push on 2025-09-16 (no corresponding tagged updates are shown in the provided data).
  • Update cadence: Based on the listed history (2019 updates in v2.x, then v3.0.0 in 2021), updates appear infrequent, with a gap of multiple years from the last published update to today (2026-09-10).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v3.0.0

    Release v3.0.0 makes p-try a major version update by switching to a pure ESM-only package and raising the supported Node.js versions. The implementation and TypeScript types were adjusted accordingly, and CI/test tooling was modernized.

    Breaking
  • v2.2.0

    v2.2.0 focuses on changing how p-try is exported for TypeScript consumers, aiming for CommonJS compatibility. The actual diff also introduces a small runtime export addition to support default-style imports, plus changes to the package's type test tooling.

  • v2.1.0

    Version 2.1.0 adds TypeScript definitions to improve type support for the package. No other user-facing changes, fixes, or upgrades are described in the release notes.

    Features