0.2.3 • Published 8 years ago

metemq-thing-js v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

MeteMQ Thing JS

MeteMQ Thing library for Node.js

Getting Started

Install MeteMQ Thing JS package

npm i --save metemq-thing-js
var Thing = require('metemq-thing-js').Thing;
var thing = new Thing('MY_FIRST_METEMQ_THING_JS');

var sub = thing.subscribe('demo')

sub.on({
    added(name, age) {
        console.log(`${name}(${age})`);
    }
});

thing.call('hello', function(result) {
    console.log(`hello ${result}!`);
});

const temp = thing.bind('temp');

setInterval(function() {
    temp.set(Math.random());
}, 2000);

thing.actions({
  print(c, ...args){
    console.log(`message from server: ${args}`);
    c.done();
  }
})

How to test?

npm test

Or, in order to watch

gulp watch
0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago