Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
async-retry.ts
Advanced tools
async await version of co-retry.js(https://www.npmjs.com/package/co-retry.js), which can be used in both TypeScript and JavaScript.
async await version of co-retry.js, which can be used in both TypeScript and JavaScript.
[](https://sonarcloud.io /dashboard?id=Jeff-Tian_async-retry.ts)
npm install async-retry.ts --save
import Action from 'async-retry.ts'
const action = () => {}
const handlers = [
{
error: 'error1',
handler: yourHandler1,
},
{
error: 'error2',
handler: yourHandler2,
},
]
Action.retry(action, 3, handlers)
import Action from 'async-retry.ts'
const action = async()=>{}
const handlers = [{
error: 'error1',
handler: async yourHandler1()=>{}
}, {
error: 'error2',
handler: async yourHandler2()=>{}
}]
await Action.retryAsync(action, 3, handlers)
const Action = require('async-retry.ts').default
const action = () => {}
const handlers = [
{
error: 'error1',
handler: yourHandler1,
},
{
error: 'error2',
handler: yourHandler2,
},
]
Action.retry(action, 3, handlers)
const Action =require('async-retry.ts').default
const action = async()=>{}
const handlers = [{
error: 'error1',
handler: async yourHandler1()=>{}
}, {
error: 'error2',
handler: async yourHandler2()=>{}
}]
await Action.retryAsync(action, 3, handlers)
修改代码后跑
npm test
确保测试通过。
git commit
npm version patch/minor/major
npm publish
FAQs
async await version of co-retry.js(https://www.npmjs.com/package/co-retry.js), which can be used in both TypeScript and JavaScript.
We found that async-retry.ts 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.