Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
better-retry
Advanced tools
A better way to handle retries on promise-returning/async functions, with ESM, CJS, AMD and UMD support.
It is basically p-retry rewritten in Typescript with Commonjs support.
# npm
npm i better-retry
# yarn
yarn add better-retry
You can read docs here.
import { betterRetry, FailedAttemptError } from 'better-retry';
const run = async (attempt: number) => {
if (attempt > 5) return 'Success!';
throw new Error('Failed');
};
const onError = (error: FailedAttemptError) => {
console.log(`Attempt ${error.attempt} failed. There are ${error.retriesLeft} retries left.`);
}
console.log(await betterRetry(run), { retries: 5, onFailedAttempt: onError }); // Success!
Every contribution is really welcome!
If you feel that something can be improved or should be fixed, feel free to open an issue with the feature or the bug found.
If you want to fork and open a pull request (adding features or fixes), feel free to do it. Remember only to use the dev
branch as a base.
Read the contributing guidelines
Read the licence
FAQs
Basically a rewrite of p-retry
The npm package better-retry receives a total of 0 weekly downloads. As such, better-retry popularity was classified as not popular.
We found that better-retry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.