jingle-stanza
v2.1.0
Published
A jingle.js utility for creating xml stanzas from objects
Downloads
26
Readme
#Jingle Stanza
Jingle Stanzas is a utility for using jxt to translate Jingle objects (from jingle.js) to and from xml stanzas similar to stanza.io, but for use with an xmpp library other than stanza.io. It is largely based on stanza.io, using the jxt definitions for stanzas created therein. Credit where it's due: stanza.io.
##Usage
jingleStanza = require('jingle-stanza');
jingle = new Jingle()
jingle.on('send', function(data) {
var xml = jingleStanza.getXml(data);
myXmppServer.send(xml);
});
myXmppServer.on('iq:set:jingle', function(stanza) {
var data = jingleStanza.getData(stanza);
jingle.process(data);
});