Skip to content

zhaogongchengsi/onion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@zunh/onion

npm version bundle JSDocs

A simple middleware onion model.

Usage

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();

License

MIT License © 2023-PRESENT zhaozunhong

About

A simple middleware onion model.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published