XMPP middleware for JavaScript
npm install @xmpp/middlewareMiddleware for @xmpp/client and @xmpp/component.
Supports Node.js and browsers.
``sh`
npm install @xmpp/middleware
`js
import { Client } from "@xmpp/client";
import middleware from "@xmpp/middleware";
const client = new Client();
const app = middleware({ entity: client });
`
The use method registers a middleware for incoming stanzas.
`js`
app.use((ctx, next) => {});
The filter method registers a middleware for outgoing stanzas.
`js``
app.filter((ctx, next) => {});