npm.io
0.14.0 • Published 10 months ago

@xmpp/middleware

Licence
ISC
Version
0.14.0
Deps
4
Size
13 kB
Vulns
0
Weekly
0
Stars
2.3K

middleware

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

Supports Node.js and browsers.

Install

npm install @xmpp/middleware

Usage

import { Client } from "@xmpp/client";
import middleware from "@xmpp/middleware";

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) => {});

Keywords