0.12.0 • Published 3 years ago

@hallparty/xmpp-middleware v0.12.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

middleware

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

Supports Node.js and browsers.

Install

npm install @hallparty/xmpp-middleware

Usage

const { Client } = require("@hallparty/xmpp-client");
const middleware = require("@hallparty/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) => {});