protocol parser

This repository contains the protocol specification and JavaScript parser for the Bid.IO protocol.

Current protocol revision: 1.

Encodes a Packet object as a string.

Returns a Packet object for the given string. If a parsing error occurs the returned packet is an error object.

Array of packet type keys.

Each packet is represented as a vanilla Object with a type key that can be one of the following:

  • Packet#JOIN (0)
  • Packet#LEAVE (1)
  • Packet#FETCH (2)
  • Packet#LOCK (3)
  • Packet#UNLOCK (4)
  • Packet#COMPLETE (5)
  • Packet#ERROR (6)

All packts contains the fallowing properties:

  • type (Number) request type.
  • data (Object) bid data.
  • id (Number) bid id.

To run the test suite just do:

$ make test