spiderlink

2.0.4 • Public • Published

Spiderlink

Based on WS (UWS compatible)

Install module:

$ npm install pm2 -g
$ pm2 install spiderlink

Then expose some function in app1:

var app = require('spiderlink')('namespace');
 
app.expose('myfunction', function(data, done) {
  // some processing
  return done({ success : true, my : data });
});

On app2 call remote function:

var app = require('spiderlink')('namespace');
 
app.call('myfunction', { some : 'data'}, function(data) {
   // data = result
});

PUB/SUB

$ npm install spiderlink
var app = require('spiderlink')('namespace');
 
app.subscribe('channel1', (message) => {
  console.log('message:', message)
})
 
app.publish('channel1', { some : 'data' });

Front-end

Use dist/spiderlink.min.js and use it via window.Spiderlink

License

Apache 2

/spiderlink/

    Package Sidebar

    Install

    npm i spiderlink

    Weekly Downloads

    2

    Version

    2.0.4

    License

    Apache-2.0

    Last publish

    Collaborators

    • tknew