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

ng-http-estimate

v0.6.0

Published

Automatic $http request time estimates

Readme

ng-http-estimate

Automatic $http request time estimates

Demo, basic example, custom estimator, reporting accuracy, low-level

npm|bower install ng-http-estimate

Include 'dist/ng-http-estimate.js' script in your page and add dependency on 'http-estimate'

angular.module('app', ['http-estimate']);

Place the loading element into the body, you can also style it

<body>
    <http-estimate></http-estimate>
    ...
</body>

The element will appear automatically on HTML requests and will show estimated remaining time (if previously computed) or "loading ..." message. Optionally, include 'dist/ng-http-estimate.css' file to get the default centered style.

screenshot

Features

  • Measurements are saved in the local storage.
  • The $http requests are automatically intercepted. If you want to disable intercept and control the start / stop events, use config provider
.config(function (httpEstimateProvider) {
  httpEstimateProvider.set({
    interceptHttp: false
  });
})
  • You can pass your own estimator function via config provider. The function can use built-in estimator and should return the wait time in milliseconds. For example:
.config(function (httpEstimateProvider) {
  httpEstimateProvider.set({
    estimator: function (cacheEstimator, url) {
      console.log('need to estimate how long get request to', url, 'would take');
      var estimate = cacheEstimator(url);
      console.log('built-in cache estimator says', estimate);
      console.log('will trust it');
      return estimate;
    }
  });
})
  • You can pass 'accuracy' function via config provider to receive result after a request completes. Useful to collect analytics how accurate the measurements were
.config(function (httpEstimateProvider) {
  httpEstimateProvider.set({
    estimator: function (cacheEstimator, url) {
      ...
    },
    accuracy: function (url, estimate, took) {
      console.log('estimated request to', url, 'to take', estimate, 'took', took, 'ms');
    }
  });
})
  • Low level interface. You can inject 'httpEstimateLowLevel' into your application and call the low-level methods start(name) and stop(name). Great for custom duration estimation with http intercepts disabled.
.controller('demoController', function ($scope, httpEstimateLowLevel) {
  $scope.startLoad = function startLoad() {
    httpEstimateLowLevel.start('/foo/bar');
  };
  $scope.stopLoad = function stopLoad() {
    httpEstimateLowLevel.stop('/foo/bar');
  };
});
  • Verbose console log output for debugging.
.config(function (httpEstimateProvider) {
  httpEstimateProvider.set({
    verbose: true
  });
})

Small print

Author: Gleb Bahmutov © 2015

License: MIT - do anything with the code, but don't blame me if it does not work.

Spread the word: tweet, star on github, etc.

Support: if you find any problems with this module, email / tweet / open issue on Github