Noteworthy Programs Map

    This package has been deprecated

    Author message:

    This package is no longer maintained.

    lestia

    1.0.1 • Public • Published

    Lestia

    npm version Build Status Coverage Status Dependency Status devDependency Status

    Lestia is a library of Message-based RPC that can do callback.

    What's this ?

    Lestia is a library of Message-based RPC. It use JSON as function arguments serialized. It can pass function and can do callback!!

    Get started

    $ npm install lestia --save
    

    Tests

    $ npm install
    $ npm test
    

    References

    Create new RPC client

    var lestia = require('lestia');
    var client = lestia();
     

    Set message handler

    client.on('send', function (msg) {
      // Send message code
      SomeMessageAPI.send(msg);
    });
     
    // Receive message code
    SomeMessageAPI.addListener('receive', function (msg) {
      client.emit('receive', msg);
    });
     

    Get RPC function

    var func = client.get('function_name');
    func('arg1', [ 1, 2, 3 ]);

    Set RPC function

    client.set('function_name', function (arg1, arg2) {
      // Called by remote
    });
     

    Log and Error message handling

    client.on('error', function (err) {
      console.error(err);
    });
     
    client.on('log', function (log) {
      console.log(log);
    });

    License

    MIT License

    Keywords

    none

    Install

    npm i lestia

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • pine613