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

angularjs-shoe

v0.0.1

Published

Use shoe with angularjs

Downloads

6

Readme

angularjs-shoe

An angularjs module that enables you to use shoe websocket streaming in the browser with angularjs.

This module wraps the shoe library so that any $scope mutations are correctly wrapped with $rootScope.$apply calls so model changes are instantly reflected in the view.

Installation

npm

If you're using browserify then install via npm:

$ npm install angularjs-shoe

and require angularjs-shoe in your browserify code:

require('angularjs-shoe');

bower

If you're using bower then install using the bower command line:

$ bower install angularjs-shoe

Old school

If you just want to use the client library without a package manager then simply include the build/angularjs-bower.js or build/angularjs-bower.min.js file into your HTML:

<!DOCTYPE html>
<html>
  <head>
    <title>Example</title>
  </head>
  <body>
    <!-- AngularJS needs to be included before -->
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>

    <!-- Then you can include the angularjs-shoe module from your project -->
    <script type="text/javascript" src="/scripts/angularjs-bower.min.js"></script>

    <!-- Then your regular angular code -->
    <script type="text/javascript" src="/scripts/client.js"></script>
  </body>
</html>

Using angularjs-shoe from your AngularJS controllers

To use shoe from your controllers you simply define eugeneware.shoe as a module dependency for your app and then you can use dependency injection to refer to the shoe or reconnect variables:

// client.js
var app = angular.module('MyApp', ['eugeneware.shoe']);

app.controller('MyCtrl', function ($scope, shoe) {
  $scope.items = [];

  var stream = shoe('/invert');
  stream.on('data', function (msg) {
    // you can mutate your $scope here and it will automatically be wrapped in
    // a $rootScope.$apply:
    $scope.items.push(msg);
  });
});

If you want to use shoe and have it automatically reconnect to the websocket server when there is a network disconnection then use the reconnect function:

// client.js
var app = angular.module('MyApp', ['eugeneware.shoe']);

app.controller('MyCtrl', function ($scope, reconnect) {
  $scope.items = [];

  reconnect(function (stream) {
    stream.on('data', function (msg) {
      // you can mutate your $scope here and it will automatically be wrapped in
      // a $rootScope.$apply:
      $scope.items.push(msg);
    });
  })
  .connect('/invert');
});

Notes

The browser files build/angularjs-shoe.js and build/angularjs-shoe.min.js already have shoe and reconnect bundled with them so you don't need to include them yourself.