Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 1.3 KB

README.md

File metadata and controls

67 lines (48 loc) · 1.3 KB

Jacasr

Warning

Not maintained anymore.

About

Pure JS XMPP library for NodeJS

Jacasr is a library for NodeJS that implements the basics of xmpp protocol

Requirements

Grab the code

Check out source with

$ git clone git://github.com/tdebarochez/jacasr.git

Installation

npm install jacasr

Usage

You can find a full featured application with LePote bot. However this is the basic usage :

    var jacasr = require('jacasr');
    var conf = {login: 'user',
                password: 'pass',
                domain: 'server.com'};
    var client = new jacasr.Client(conf);
    client.on('message', function (from, message) {
      if (/^hi/i.exec(message)) {
        this.push(from, 'Hi there');
      }
      else if (/^how are you/i.exec(message)) {
        this.push(from, 'Fine and you ?');
      }
      else if (/bye/i.exec(message)) {
        this.push(from, 'Good bye !');
      }
    });

API

For the full API, take a look at documentation.

License

Jacasr is licensed under the terms of the MIT License, see the included LICENSE file.