
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
A TypeScript utility for retrying sync/async methods that throw errors.
A TypeScript utility for retrying sync/async methods that throw errors.
Basic usage:
import { retry } from "@1ib/retry"
class {
// Use the `retry` decorator to retry a method if it throws an error,
// for a maximum of 3 tries.
@retry(3)
foo() {
// This method can return anything or throw an error.
}
}
For async
methods:
class {
// Same as before, but an async function, which means it returns a Promise.
// It also retries up to 3 times if an error is thrown.
@retry(3)
async foo() {
// This method can return anything or throw an error.
}
}
For custom retry logic:
import fs from "fs/promises"
class {
// This method retries up to 3 times if an error is thrown,
// and only if the error is an `ENOENT` or `ENFILE` error.
@retry(async ({ code }: Result | Error, attempts: number) =>
(code === "ENFILE" || code === "EMFILE") && attempts < 3)
async foo(@attempts attemps?: number) {
console.info(`This method has been called ${attempts} times.`)
return fs.readFile("README.md", "utf8")
}
}
Install using [npm][npm] or [yarn][yarn]:
npm install @1ib/retry
# or
yarn add @1ib/retry
Import into your Node.js project:
// CommonJS
const { retry } = require("@1ib/retry")
// ESM
import { retry } from "@1ib/retry"
Install using JSR:
deno add @1ib/retry
#or
jsr add @1ib/retry
Then import into your Deno project:
import { retry } from "@1ib/retry"
Install using this command:
bun add @1ib/retry
Import into your Bun project:
import { retry } from "@1ib/retry"
This project is licensed under the MIT.
FAQs
A TypeScript utility for retrying sync/async methods that throw errors.
The npm package @1ib/retry receives a total of 0 weekly downloads. As such, @1ib/retry popularity was classified as not popular.
We found that @1ib/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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.