Beam information at the speed of light -- dirt-simple RPC for Node.js
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md

README.md

Laser

Beam information at the speed of light -- dirt-simple RPC for Node.js.

(This has been tested up to Node.js v0.4.5.)

Install

Get npm if you don't already have it, and then just run npm install choreographer.

Usage

As easy as

//on the server
var beam = require('laser').beam;
beam.everyone('send', function(name, message) {
  beam.everyone.receive(name, message);
});

and on the client

<script type="text/javascript" src="/laser/beam.js"></script>
<script type="text/javascript">
  beam('receive', function(name, message) {
    $('#messages').append('<p>' + name + ': ' + message);
  });
  $('#send-button').click(function() {
    beam.send($('#text-input').val());
    $('#text-input').val('');
  });
</script>