Back to Explore

sindresorhus/p-try

GitHub
1 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 GitHub repo shows an upstream push on 2025-09-16, but the latest published updates in the provided release history are from 2021-10-04 (v3.0.0), suggesting the project is mostly in a quiet or maintenance mode rather than actively shipping frequent updates.
  • Update cadence: Documented version updates are infrequent (v3.0.0 in 2021, prior updates in 2019, and v2.1.0 also in 2019), indicating a multi-year cadence typical of low-churn utility packages.

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