anyflow

[![npm](https://img.shields.io/npm/v/anyflow.svg?style=flat-square)](https://www.npmjs.com/package/anyflow)

Stats

StarsIssuesVersionUpdatedCreatedSize
anyflow
000.3.02 years ago3 years agoMinified + gzip package size for anyflow in KB

Readme

anyflow

npm

npm jsdelivr

NOT only http server need middleware !!

HOW-TO-USE

const { App } = require('anyflow');
const app = new App();
// use function as middleware
app.use(async (context, next) => {
    // you can get or set data from context.data
    return await next(); // call next middleware
});
// or use middleware
app.use({
    invoke: async (context, next) => {
        return await next();
    }
});
// or use middleware factory
app.useFactory({
    get: () => ({
        // factory allow you make a new middleware for each times.
        invoke: async (context, next) => {
            return await next();
        }
    })
});
// then run middleware chain.
app.run();

reference

  • Asp.Net Core middleware

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.