JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5442
  • Score
    100M100P100Q118513F
  • License MIT

A library to make sense of a bunch of middleware definitions and return a simple array of middleware"

Package Exports

  • loadware

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (loadware) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

loadware

Make sense of a bunch of middleware definitions and return an array of middleware:

const loadware = require('loadware');

let router = require('express').Router();
router.get('/', (req, res) => { res.send('Hello there'); });

let middlewares = loadware(
  'body-parser',
  (req, res, next) => { next(); },
  './middle/whatever.js',
  router
);

The middleware can be a string, a function or an array of any of the previous.

This is part of another project which is WIP right now, but I think this is independently enough so it can be launched separately.