javascript-protocol-framework

0.1.2 • Public • Published

Javascript Protocol Framework

Build Status

A protocol is a contract between different entities on how they go about their communication. This library is a framework, built in javascript, to facilitate building such contract.

Installation

npm install javascript-protocol-framework

Example

// Server-side protocol
protocol.addReceiver('ping', function(message) {
  message.reply('pong');
});

// Client-side session
session.send({type: 'ping'}, function(message) {
  message.data === 'pong'
})

Goals

  • Allow simultaneous multi-step communication
  • Memory-efficient enough for server-side usage
  • Must work cross platform (NodeJS, browser)
  • Make business logic independend from the used transportation layer

Documentation

See the 'full' implementation of the json-tcp module for an example.

Test

To start the mocha test suite:

grunt test

Browser-testing:

zuul --local 8000 test/_test.js
zuul -- test/_test.js

License

MIT

Package Sidebar

Install

npm i javascript-protocol-framework

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • boljen