bacon-express
v1.1.1
Published
Link Bacon streams over the network
Downloads
11
Readme
Bacon Express
Link Bacon streams over the network
Installation
Node
npm i bacon-express
Browser
<script src='https://cdn.rawgit.com/ISNIT0/bacon-express/master/dist/client.js' type='text/javascript'></script>
Usage
Node
var app = express();
baconExpress(app);
var Events = Bacon.Bus();
app.bacon('/events', Events); // (HTTPpath, stream, handler?)
Browser
var Events = Bacon.fromWebsocket('/events'); //Relative or absolute Websocket path (ws://localhost:1337/events)
Events.onValue(function(a) {
console.log(a);
});
In the above example, the Events stream (Bus in this case) from both the server and client are in sync.