bacon-express

1.1.1 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i bacon-express

Weekly Downloads

1

Version

1.1.1

License

Unlicense

Last publish

Collaborators

  • isnit0