Composable Middleware allows developers to treat a sequence of Connect, Flatiron/Union, or hybrid middleware functions as a single, unified middleware function. The package, currently at version 0.3.1, is explicitly marked as abandoned and no longer actively maintained. Its core differentiation lies in its minimal overhead design, focusing solely on function composition without built-in support for URL routing, path mounting, or comprehensive error handling (like 404/500 responses), which are left to the parent framework. It identifies middleware types based on function arity (e.g., `(req,res,next)` for Connect normal middleware, `(err,req,res,next)` for error handling). Given its abandoned status, there is no active release cadence, and users are encouraged to consider maintained forks or alternative solutions.
npm install composable-middlewareVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to compose multiple middleware functions into a single unit using `composable-middleware` and integrate it into a `connect` application. It includes basic logging and a response.
Migrate to a maintained fork (e.g., `ineentho/composable-middleware`) or an alternative middleware composition library. Assess the risks of continued use.
Use CommonJS `require()` syntax: `const composable_middleware = require('composable-middleware');`. For ESM projects, consider dynamic `import()` or a build step to transpile.Implement explicit routing middleware (e.g., `express.Router()`) before or after your composed middleware, and ensure a final middleware handles 404/500 errors if the request reaches the end of the stack without a response.
Thoroughly test on your target Node.js version. Be aware that certain Node.js APIs might have changed behavior or been deprecated since the package's last update.
Ensure you are using `const composable_middleware = require('composable-middleware');` for CommonJS projects or if dynamically importing in ESM.If in an ESM module, you must use dynamic import `const composable_middleware = await import('composable-middleware');` or refactor your project to use CommonJS where this package is needed. The `composable-middleware` package itself is CommonJS.Verify the package is installed and `require()` is correct. Ensure you invoke the main export to get an instance before calling `.use()`: `const mw = composable_middleware().use(someMiddleware);`
No dependency data recorded yet.