0.9.3 • Published 4 years ago

@xmpp-infister/middleware v0.9.3

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

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