npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lisa-api

v1.7.5

Published

Lisa Javascript XMPP Library =============

Downloads

6

Readme

Lisa Javascript XMPP Library

Overview

The Lisa Javascript XMPP Library is a javascript library that can be used to connect, retrieve data from, and retrieve notifications from the XMPP API on the IPerity Compass telephony platform. The library is designed to run as local javascript in a clients web-browser.

After connecting, the library maintains a local datamodel that's automatically and constantly kept up to date from the server. Clients can explore the data-model, and listen for changes on the datamodel.

Requirements

The library depends on a number of other javascript libraries to run:

  • JQuery (http://jquery.com/download/)
  • Underscore.js (http://underscorejs.org/)
  • Backbone.js (http://backbonejs.org/)
  • Strophe.js (http://strophe.im/strophejs/)
  • Strophe pubsub plugin (https://github.com/ggozad/strophe.plugins)

Quickstart with NPM

The LisaApi library is now also available on npm.

  npm install lisa-api

Please note that the npm package doesn't specify any dependencies itself. This is because the dependencies differ wildly between using the library in the browser, or in a node.js environment. Because of this, the user of the library should still specify all dependencies mentioned above.

See examples/simple-browserify for an easy but complete example on how to use LisaApi from npm with browserify. A node.js example is forthcoming.

Quickstart

  • Create a .html page including all required javascript in separate <script> tags.
  • Include the LisaApi.js as well.

In javascript:

  • create the 'connection' object with var conn = new Lisa.Connection();
  • connect with conn.connect("hostname","username", "password");
  • Set a callback to trigger when the model is received with conn.getModel().done(function(model){});

The model is retrieved through the conn.getModel().done callback. Since conn.getModel() returns a JQuery Deferred object, this call can be used multiple times.

With the model:

  • Explore the users, queues, and calls on the platform with the model.users, models.queues, and models.calls arrays. Each array is keyed by item-id.
  • To listen for changes, Callbacks can be attached with a .observable.addObserver(function(model) {}); call .
  • Observers can be attached anywhere in the tree. For example: model.users["1"].observable works, but so does _.first(model.users["1"].queues).observable.

Optionally:

  • Configure logging:
conn.logging.setCallback(function(msg) {
    console.log(msg);
  });

Documentation & Examples

  • Extensive XMPP api documentation can be downloaded from the downloads section of your compass webinterface. This document contains documentation for this library as well.
  • See the examples/ directory for examples.