Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
retry-promise-func
Advanced tools
retry-promise-func 是一个用于在失败时重试 Promise 调用的工具。
使用 npm 安装: npm install retry-promise-func
使用 yarn 安装: yarn add retry-promise-func
使用方法非常简单。只需导入 retry 函数并调用它即可:
import { retry } from "retry-promise-func";
const someFunction = async (someParams) => {
return new Promise((resolve, reject) => {
console.log(someParams);
setTimeout(() => {
if (Math.random() > 0.5) {
resolve("Success");
} else {
reject("Failure");
}
}, 1000);
});
};
const main = async () => {
try {
const result = await retry(someFunction, { a: 1 }, 10, 2000);
console.log(result);
} catch (error) {
console.log(error);
}
};
main();
FAQs
retry-promise-func是一个用于在失败时重试Promise调用的工具。
The npm package retry-promise-func receives a total of 1 weekly downloads. As such, retry-promise-func popularity was classified as not popular.
We found that retry-promise-func 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.