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

intelli-timer

v1.1.2

Published

a intelligent timer

Readme

Intelli-Timer.js

Intelli-Timer provides some practical functions about time. All these functions assume you follow the Node.js convention of providing a single callback as the last argument of your asynchronous function.

Requirement

  • node >= 4.4.1

Install

npm install intelli-timer

Documentation

var timer = require('intelli-timer');

timing(function(timerCallback), [callback])

timing is used to calculate how much time spending on doing something.

Arguments

  • function(timerCallback) - put your task in this function. When the task is done, call timerCallback().
  • timerCallback() - call this function when the task is done.
  • callback(cost_time) - a callback which is called when task is finished. unit:ms

Examples

timer.timing(function(timerCallback){

    do_something(err, function(){
        timerCallback();    // timerCallback() after finish do_something()
    });

}, function(cost_time){

    console.log(cost_time);

});

countdown(timeout, function(timerCallback), [callback])

countdown is used to set a time limit for doing some task. If it spend too much time, terminate the task and show error message.

Arguments

  • timeout - time limit for doing the task. unit:ms
  • function(timerCallback) - put your task in this function. When the task is done, call timerCallback().
  • timerCallback() - call this function when the task is done.
  • callback(err) - a callback which is called when task is finished or terminated. If task spends too much time, it will callback with err.

Examples

timer.countdown(500, function(timerCallback){  // time limit is 0.5 second

    do_something(err, function(){
        timerCallback();    // timerCallback() after finish do_something()
    });

}, function(err){

    if(err) console.log(err);  // err is null when the task is completed in time
    else console.log('success');

});

repeat(interval, duration, task, [callback])

repeat is a function that repeat the same function in duration.

Arguments

  • interval - the interval that function is called.
  • duration - the repeated duration.
  • task() - a function will be repeated.
  • callback() - a callback will be called after finish repeating.

Examples

timer.repeat(100, 900, function(){  // interval is 100ms, duration is 900ms

    console.log('Hello World'); // print out 'Hello World' for nine or ten times

}, function(){

    console.log('finish');  // finish and print 'finish'

});