Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
axios-extra
Advanced tools
通过 ES6 的Proxy
对像, 让 axios 集成 promise-queue-plus, 使 axios
支持 最大并发 及 出错重试 的功能.
未添加任何 API, 你完全可以像使用
axios
那样使用axios-extra
; 由于使用了Proxy
,请注意兼性.
现在可以通过设置 maxConcurrent
和 queueOptions
属性, 设置最大并发及重试次数.
// axios 并发为10, 自动重试为0
const axios = require('axios-extra'); //默认最大并发 10, 重试 0;
// 创建一个 并发为1, 自动重试为3的 axios;
let axios1 = axios.create({
maxConcurrent:1, //并发为1
queueOptions: {
retry:3, //请求失败时,最多会重试3次
retryIsJump: true //是否立即重试, 否则将在请求队列尾部插入重试请求
}
});
更多
queueOptions
配制可参看这里
config
参数可以为某一次的请求设置 queueOptions
;
axios.get('https://www.google.com',{
queueOptions : {
retry: 5
}
});
create(axios,maxConcurrent,queueOptions)
扩展现有 axios
扩展项目中现有 axios
,保证 axios
版本.
const aec = require('axios-extra/create');
const axios = aec(requeir('axios'), 5, { retry: 5 });
FAQs
Extend "Axios"; add concurrency limits, retry, etc.
The npm package axios-extra receives a total of 5 weekly downloads. As such, axios-extra popularity was classified as not popular.
We found that axios-extra 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
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.