A simple middleware onion model.
npm install @zunh/onion
pnpm install @zunh/onion
yarn add @zunh/onion
import Onion from '@zunh/onion';
const onion = new Onion();
onion.use(async (ctx, next) => {
console.log('1');
await next();
console.log('2');
});
onion.use(async (ctx, next) => {
console.log('3');
await next();
console.log('4');
});
onion.run();
MIT License © 2023-PRESENT zhaozunhong