JXT definitions for XMPP
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.eslintignore Initial Jul 2, 2015
.eslintrc Initial Jul 2, 2015
.gitignore Initial Jul 2, 2015
.jshintignore Fix read-only properties to be writable, as some stanzas try to overw… Apr 20, 2018
.jshintrc Fix read-only properties to be writable, as some stanzas try to overw… Apr 20, 2018
.npmignore Initial Jul 2, 2015
CONTRIBUTING.md Initial Jul 2, 2015
LICENSE Initial Jul 2, 2015
README.md Fix typo Jul 2, 2015
SECURITY.md Initial Jul 2, 2015
package.json

README.md

JXT-XMPP

This is a collection of JXT (JSON/XML translator) definitions for XMPP.

These definitions were originally part of the Stanza.io XMPP library, but have been split off into their own module so that they can be used with other projects (such as the node-xmpp family of libraries).

Getting Started

The basic boilerplate to start using the XMPP definitions is:

// Create registry and load required helper plugin
var JXT = require('jxt').createRegistry();
JXT.use(require('jxt-xmpp-types'));

// Load the XMPP definitions
JXT.use(require('jxt-xmpp'));

var stanza = JXT.parse('<message xmlns="jabber:client"><body>Hi!</body></message>');
console.log(stanza.body);
// -> Hi!

var Message = JXT.getMessage();
var msg = new Message({ body: 'Hey' });
console.log(msg.toString());
// -> '<message xmlns="jabber:client"><body>Hey</body></message>'

Here we created our JXT registry, and first loaded the jxt-xmpp-types plugin to provide some required JXT helper types and methods.

With that bit of setup out of the way, we can load the jxt-xmpp module itself.

License

MIT

Created By

If you like this, follow @lancestout on twitter.