Have ideas to improve npm?Join in the discussion! »

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.

Keywords

none

Install

npm i bacon-express

DownloadsWeekly Downloads

5

Version

1.1.1

License

Unlicense

Last publish

Collaborators

  • avatar