telepathy-server

0.2.2 • Public • Published

Telepathy Server

Telepathy is a lightweight Node.js library for remote procedure calls using proxy objects.

Getting Started

To work with Telepathy you must have installed Node.js version 8 or higher.

Installation

npm install --save telepathy-server

Usage

Let's write simple service:

const {Service, Server, Transports: {WebSocketTransport}} = require('telepathy-server');

class DemoService extends Service {
	constructor() {
		// You have to define which methods should be exposed
		super({}, 'welcome');
	}

	welcome(name) {
	    return `Hello, ${name}.`;
	}
}

const service = new DemoService();
const transports = [new WebSocketTransport({port: 9001})];
const server = new Server(transports, service);

server.start();

See also

License

This project is licensed under the MIT License.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.2
    2
  • 0.2.1
    2
  • 0.2.0
    2
  • 0.1.0
    2

Package Sidebar

Install

npm i telepathy-server

Weekly Downloads

8

Version

0.2.2

License

MIT

Unpacked Size

26.8 kB

Total Files

19

Last publish

Collaborators

  • misp44