0.0.1 • Published 7 years ago

ember-cli-strophe-shim v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

ember-cli-strophe-shim

Build Status npm Version Ember Observer Score Ember badge

ES6 accessible modules for Strophe within your Ember applications.

Installation

ember install ember-cli-strophe-shim

Usage

import Strophe from 'ember-cli-strophe-shim';
import Connection from 'ember-cli-strophe-shim/connection';
import Builder, { $pres } from 'ember-cli-strophe-shim/builder';

Ember.debug(`Strophe version ${ Strophe.VERSION }`);
Ember.assert('Builder is a constructor', Ember.typeOf(new Builder('iq')) === 'object');

let c = new Connection('http://localhost:5280/http-bind/');
c.connect('me@my-server.com', 'my-password');

// ... then later

c.send($pres());

Strophe Plugins

To enable a Strophe plugin include it in your config like so:

  • config/environment.js
module.exports = function(environment) {
  return {
     strophe: {
       plugins: [
         'ping',
         'roster'
       ]
     }
  };
};

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server