🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

bacon-express

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bacon-express

Link Bacon streams over the network

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 20 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts