Next Compose Middleware

JSON →
library 1.0.0 ·javascript
verified May 27, 2026

next-compose-middleware is a library designed to simplify the creation of complex and declarative middleware for Next.js applications, particularly leveraging Next.js's Edge Runtime middleware. It enables developers to construct highly readable and maintainable middleware logic by composing multiple functions. The current stable version is 2.0.4, indicating active development with incremental releases. Key differentiators include its path-based middleware execution, allowing for "Nested Middleware" behavior, and the ability to compose functions with early exit mechanisms (`breakAll`, `breakOnce`) for fine-grained control over execution flow. This approach helps in organizing middleware into logical, reusable units, enhancing maintainability for applications with intricate authorization, authentication, or request transformation requirements in a single `middleware.ts` file.

total hits 15
actors 7 distinct systems
last hit 2d ago human
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇮 Finland