@xmpp-infister/middleware
v0.9.3
Published
XMPP middleware for JavaScript
Downloads
20
Readme
middleware
Middleware for @xmpp-infister/client
and @xmpp-infister/component
.
Supports Node.js and browsers.
Install
npm install @xmpp-infister/middleware
Usage
const {Client} = require('@xmpp-infister/client')
const middleware = require('@xmpp-infister/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) => {})