metemq-thing-js
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i metemq-thing-js

Weekly Downloads

0

Version

0.2.3

License

MIT

Last publish

Collaborators

  • metemq