jingle-stanza

A jingle.js utility for creating xml stanzas from objects

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
jingle-stanza
102.1.05 years ago9 years agoMinified + gzip package size for jingle-stanza in KB

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);
});