0.13.3 • Published 6 months ago

@xmpp/middleware v0.13.3

Weekly downloads
2,826
License
ISC
Repository
-
Last release
6 months ago

middleware

Middleware for @xmpp/client and @xmpp/component.

Supports Node.js and browsers.

Install

npm install @xmpp/middleware

Usage

const { Client } = require("@xmpp/client");
const middleware = require("@xmpp/middlware");

const client = new Client();
const app = middleware({ entity: client });

use

The use method registers a middleware for incoming stanzas.

app.use((ctx, next) => {});

filter

The filter method registers a middleware for outgoing stanzas.

app.filter((ctx, next) => {});