@xatellite/jxmpp

0.2.2 • Public • Published

JXMPP

This is a simple abstraction over jxmpp, which provides some convenient function so you don't have to deal with xml and xmpp directly.

Usage

To use this library in Node, you first have to register CoffeeScript.

require 'coffeescript/register'
JXMPP = require './jxmpp'

After that, you have to define callbacks for messages and presence updates.

message_callback = function (from, message) {}
presence_callback = function (from, type, show, status) {}

Now you can instatiate the xmpp class

jxmpp = JXMPP(message_callback, presence_callback)

To send a new message, simply call

jxmpp.send("user@example.com", "Hello World!")

And finally, to update your presence status, run

jxmpp.available("Status message")  // Status message is optional
jxmpp.unavailable("<show>", "Status message")  // Status message is optional

where is required and one of

["dnd", "away", "xa"]

Readme

Keywords

Package Sidebar

Install

npm i @xatellite/jxmpp

Weekly Downloads

7

Version

0.2.2

License

MPL-2.0

Unpacked Size

57.1 kB

Total Files

13

Last publish

Collaborators

  • thenewcivilian
  • zandemax