
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@wroud/flow-middleware
Advanced tools
A lightweight middleware management library for JavaScript and TypeScript, facilitating middleware chains with re-runs, error handling, and disposability.
@wroud/flow-middleware is a lightweight middleware management library for JavaScript and TypeScript. It facilitates the creation and execution of middleware chains with support for re-runs, error handling, and disposability. Inspired by modern middleware patterns, it leverages TypeScript for type safety and ESM for optimal performance.
Install via npm:
npm install @wroud/flow-middleware
Install via yarn:
yarn add @wroud/flow-middleware
For detailed usage and API reference, visit the documentation site.
import { FlowMiddleware } from "@wroud/flow-middleware";
import type {
IMiddleware,
IErrorMiddleware,
} from "@wroud/flow-middleware/interfaces";
/**
* Simple Middleware Example
*/
const simpleMiddleware: IMiddleware<{ message: string }> = async (
req,
next,
triggerReRun,
subscribe,
) => {
console.log("Middleware: Processing message:", req.message);
await next();
};
/**
* Simple Error Middleware Example
*/
const simpleErrorMiddleware: IErrorMiddleware<{ message: string }> = async (
error,
req,
next,
triggerReRun,
subscribe,
) => {
console.error("ErrorMiddleware: An error occurred:", error.message);
// Handle error, modify request data, or trigger re-run
req.message = "Error handled";
triggerReRun();
};
const middleware = new FlowMiddleware();
// Register middlewares
middleware.register(simpleMiddleware);
middleware.registerErrorMiddleware(simpleErrorMiddleware);
// Create a new request with initial data
const request = middleware.createRequest({ message: "Hello, FlowMiddleware!" });
// Execute the middleware chain
(async () => {
try {
await request.execute();
} catch (error) {
console.error("Main: Error executing middleware chain:", error);
}
})();
All notable changes to this project will be documented in the CHANGELOG file.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A lightweight middleware management library for JavaScript and TypeScript, facilitating middleware chains with re-runs, error handling, and disposability.
We found that @wroud/flow-middleware demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.