
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.
Process organizer of asynchronous or/and synchronous interdependent code units
通过注册位置信息并在其上绑定工作器回调,本包可用于以正确的顺序组织异步或同步代码流程。
An Organizer of Code Units that Depend on Each Other - Aocudeo, can organize your pipelining work with the correct order through the 'Position' registered by 'Workers'.
在索引模块中弄个加载器用来加载模块。
Get a public loader for your plugins in the index.
import Loader from 'aocudeo/async';
export const loader = new Loader({ reuseable: false });
根据插件名称和位置信息插入插件。
Insert the plugin with its name and dependencies' name.
loader
.addPosition('foo', {
after: ['bar', 'baz'],
preOf: 'foobar',
})
.addWorker('foo', async () => {
await import('./plugins/foo.ts');
});
loader.execute();
借以 p-graph 的示例代码为例。
Do what p-graph's sample code do.
import Organizer, { Positions } from 'aocudeo/async';
const workers = new Map([
["putOnShirt", { run: () => Promise.resolve("put on your shirt") }],
["putOnShorts", { run: () => Promise.resolve("put on your shorts") }],
["putOnJacket", { run: () => Promise.resolve("put on your jacket") }],
["putOnShoes", { run: () => Promise.resolve("put on your shoes") }],
["tieShoes", { run: () => Promise.resolve("tie your shoes") }],
]);
const positions: Positions = [
// You need to put your shoes on before you tie them!
["putOnShoes", "tieShoes"],
["putOnShirt", "putOnJacket"],
["putOnShorts", "putOnJacket"],
["putOnShorts", "putOnShoes"],
];
await new Organizer({ workers, positions }).execute();
以下这个用例导出一个用于得到一个穿好衣服的人的函数 getPerson 。
The following usage exports getPerson to obtain a person dressed properly.
import Organizer from "aocudeo/async";
export interface Person {
shorts?: 'shorts';
shoes?: 'shoes';
tied: boolean;
}
const organizer = new Organizer<Person>()
.addPositions({
putOnShoes: 'putOnShorts',
tieShoes: { postOf: 'putOnShoes' },
})
.addWorkers({
async putOnShorts({ data: person }) {
person.shorts = await Promise.resolve('shorts');
},
async putOnShoes({ data: person }) {
person.shoes = await Promise.resolve('shoes');
},
async tieShoes({ data: person }) {
person.tied = await Promise.resolve(true);
},
});
export async function getPerson() {
return await organizer.execute({ tied: false });
}
功能上与本包类似。
Functionally similar to this package.
FAQs
Process organizer of asynchronous or/and synchronous interdependent code units
The npm package aocudeo receives a total of 0 weekly downloads. As such, aocudeo popularity was classified as not popular.
We found that aocudeo 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
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.