meshblu-websocket

4.0.0 • Public • Published

meshblu-websocket

Pure websocket implementation of the Meshblu client

Build Status npm version Gitter

Install

npm install meshblu-websocket

Example

var MeshbluWebsocket = require('meshblu-websocket');
var MeshbluConfig = require('meshblu-config');
 
var meshbluConfig = new MeshbluConfig().toJSON();
var meshblu = new MeshbluWebsocket(meshbluConfig);
 
meshblu.connect(function(error){
  if (error) {
    console.error(error.message);
  }
 
  meshblu.subscribe({uuid: meshbluConfig.uuid});
 
  meshblu.on('config', function(data){
    console.log('config', data);
  });
 
  meshblu.updateDangerously({
    uuid: meshbluConfig.uuid,
    token: meshbluConfig.token
  }, {
    '$push': {
      stuff: {
        foo: 'bar'
      }
    }
  });
});

/meshblu-websocket/

    Package Sidebar

    Install

    npm i meshblu-websocket

    Weekly Downloads

    8

    Version

    4.0.0

    License

    MIT

    Last publish

    Collaborators

    • sqrtofsaturn
    • royvandewater
    • peterdemartini
    • chrismatthieu
    • iamruinous
    • octoblu-user