
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
aokai-request-queue
Advanced tools
```ts import {createQueueRequest, defaultRejectTaskAuth, createRequestTask} from "aokai-request-queue";
import {createQueueRequest, defaultRejectTaskAuth, createRequestTask} from "aokai-request-queue";
// 创建队列
const request = createQueueRequest(3, {
base_url: "http://localhost:3000",
})
// 注册任务
const getList = createRequestTask<void, {name: string}[]>({
url: "/list",
type: "get",
headers: {
// 添加headers
}
})
// 创建请求任务
const getListTask = getList()
request.add(getListTask).then(res => {
// 请求成功
}).catch(err => {
// 请求失败
})
import {defaultRejectTaskAuth} from "aokai-request-queue"
// 使用插件(401后重新请求更新token)
request.use(defaultRejectTaskAuth({
url: "<重新请求地址>",
method: "<重新请求类型>",
params: () => {<重新请求参数>},
resolve: (res: any) => {
// 重新请求成功后的token
},
reject: (err: any) => {
// 重新请求失败
}
}))
import {QueuePlugin, RequestTask, QueueHandler} from "aokai-request-queue";
import {AxiosError, AxiosInstance} from "axios";
// 创建插件
export function myPlugin(data?: any): QueuePlugin {
return {
/**
* 在任务执行前(可选)
* @param instance axios实例
* @param task 当前任务
* @param handler 队列处理器
*/
beforeRunTask(instance: AxiosInstance, task: RequestTask, handler: QueueHandler) {
},
/**
* 当任务执行失败(可选)
* @param request axios实例
* @param task 当前任务
* @param handler 队列处理器
* @param err 错误
*/
onReject(request: AxiosInstance, task: RequestTask, handler: QueueHandler, err: AxiosError) {
}
}
}
// 使用插件
request.use(myPlugin())
FAQs
```ts import {createQueueRequest, defaultRejectTaskAuth, createRequestTask} from "aokai-request-queue";
The npm package aokai-request-queue receives a total of 52 weekly downloads. As such, aokai-request-queue popularity was classified as not popular.
We found that aokai-request-queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.