the

thebombemachine

A small Javascript utility class to allow easy connection and communication with a secret-hitler (https://github.com/kylecoburn/secret-hitler.git) server

Showing:

Popularity

Downloads/wk

6

GitHub Stars

2

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

2

Size (min+gzip)

14.9KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

The Bombe Machine

A small Javascript utility class to allow easy connection and communication with a Secret Hitler server. It is designed to work with Kyle Coburn's secret-hitler: https://github.com/kylecoburn/secret-hitler.git

Named after Alan Turing's (with a few other contributors) invention, the Bombe, which during World War II assisted in deciphering German communications. See https://wikipedia.org/wiki/Bombe.

Installation

npm install thebombemachine --save

Usage

Instantiation

//Node.js
var BombeMachine = require("thebombemachine");
var Bombe = new BombeMachine(custom_server_URL [optional]);

//Vanilla JavaScript
var Bombe = new BombeMachine(custom_server_URL [optional]);

Set up connection

Bombe.doSetup(callback_function);

Do communications

The object must have been set up first.

Handle incoming messages

var handlerID = Bombe.onReceive(callback_function);

Handle outgoing messages

var handlerID = Bombe.onSend(callback_function);

Delete event handler (either incoming or outgoing)

Bombe.removeHandler(handlerID);

Send a message to the server

Bombe.send(message_string);

Ping the server

Bombe.ping(callback_function);

Control auto-ping (the server will close the connection if it's not pinged regularly)

Bombe.startAutoPing(interval_ms [optional], timeout_ms [optional]);
Bombe.stopAutoPing();

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100