npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-pusher-bridge

v0.1.4

Published

Pusher to angular bridge

Readme

Angular-pusher bridge

This library is an open source angular bridge to the Pusher.

Usage overview

Installation

Bower

bower install angular-pusher-bridge

and then

<script src="bower_components/angular-pusher-bridge/angular-pusher.min.js" type="text/javascript"></script>

NPM

npm install angular-pusher-bridge

and then

<script src="node_modules/angular-pusher-bridge/angular-pusher.min.js" type="text/javascript"></script>

Configuration

The service provider provides the following methods:

  • .setApiKey('KEY') - set pusher application key;
  • .option(name, value) or .option({name: value}) - Configuring the pusher's client. Available pusher options;
  • .subscribe(channel) - subscribe to the channel events;
  • .alias(channel, alias) or .alias({channel: alias}) - set alias for channel

These methods are available during configuration through pusherProvider. At run time, the following methods are changing their behavior:

  • .option(name) - return pusher's option value;

Enable debugging

.option('debug', true) - enable logging (via $log) all events (default: false)

Debounce $digest

.option('debounce', int) - enable debounce $rootScope.$digest. Run $digest after 'milliseconds' (default: 50)

Binding to events

This module is designed for integration events received through the pusher, into the system event angular. Events propagate from $rootScope.

$scope.$on('channel:event', function (angularEvent, pusherEventData) {
    $log.debug(pusherEventData);
});

or

$scope.$on('global_event', function (angularEvent, pusherEventData) {
    $log.debug(pusherEventData);
});

If the channel has been set an alias, the name of the event instead of the name of the channel will be used an alias:

pusherProvider.alias('channel', 'alias');
$scope.$on('alias:event', function (angularEvent, pusherEventData) {
    $log.debug(pusherEventData);
});

Examples

angular.module('app', ['angular-pusher'])
    .config(['pusherProvider', function (provider) {
        provider.setApiKey('XXXXX');
        provider.option({
            debug: true,
            cluster: 'eu'
        });
        // subscribe to channel during configuration.
        provider.subscribe('my_channel');
        // subscribe to dynamic generation channel name
        provider.subscribe('private-channel-' + user.id);
        // making dynamic name - static, by specifying an alias
        provider.alias('private-channel-' + user.id, 'personal-events'); 
    }])
    .controller('ctrl', ['$scope', '$window', 'pusher', 'pusherProvider', function ($scope, $window, pusher, pusherProvider) {
        // subscribe to channel in runtime
        pusherProvider.subscribe('runtime_channel');
        // Bind listeners
        $scope.$on('my_channel:new_message', function (event, data) {
            $window.alert($window.JSON.stringify(data));
        });
        $scope.$on('personal-events:new_message', function (event, data) {
            $window.alert($window.JSON.stringify(data));
        });
        // use original pusher client
        pusher; 
    }])

Demo

https://disparity.github.io/angular-pusher/#demo