Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable node/no-extraneous-require */
'use strict'
const {component, xml} = require('@xmpp/component')
const debug = require('@xmpp/debug')
const xmpp = component({
service: 'xmpp://localhost:5347',
domain: 'component.localhost',
password: 'mysecretcomponentpassword',
})
debug(xmpp, true)
xmpp.on('error', err => {
console.error(err)
})
xmpp.on('offline', () => {
console.log('offline')
})
xmpp.on('stanza', async stanza => {