0.1.2 • Published 9 years ago

alfred-node-client v0.1.2

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

Alfred Node Client

A minimal client library to connect and interact with alfred servers.

Installation

  npm install alfred-node-client --save

Usage

  var alfred = require('alfred-node-client');

  var AlfredClient = require('alfred-node-client');

  var client = new AlfredClient(
      {
        name: 'test_node',  // Your client's name (optional)
  	    host: 'localhost',  // Your server's host
  	    port: 13100,  // Your server's port
  	    login: 'login',  // Your server's username
  	    password: 'password', // Your server's password
  	    onConnect: function () {
              console.log('loginned !');
              client.Lights.getAll().then(function(lights){
                  console.log(lights);
              }, function(error){
                  console.log(error);
              });
          },
  	    onDisconnect: function () {
              console.log('disconnected !');
          }
      });
  
  client.subscribe(function (data) {
      console.log(data);
  });

Tests

   npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Release History

  • 0.1.0 Initial release
0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago