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

@qgustavor/git-hours

v2.1.2

Published

Estimate time spent on a git repository

Readme

@qgustavor/git-hours

Estimate time spent on a git repository. A modern fork using modern Node.js features.

For example time spent on Twitter's Bootstrap

➜  bootstrap git:(master) git-hours
{

  ...

  "total": {
    "hours": 9959,
    "commits": 11470
  }
}

From a person working 8 hours per day, it would take more than 3 years to build Bootstrap.

Please note that the information might not be accurate enough to be used in billing.

Install

$ npm install -g @qgustavor/git-hours

It might work using other JavaScript runtimes such as Deno and Bun, it's untested. There are some documented caveats: #!/usr/bin/env node is set, so Bun requires calling it using bunx --bun git-hours otherwise it will run on Node.js. As for Deno, it might work or not.

How it works

The algorithm for estimating hours is quite simple. For each author in the commit history, do the following:

Go through all commits and compare the difference between them in time.

If the difference is smaller or equal then a given threshold, group the commits to a same coding session.

If the difference is bigger than a given threshold, the coding session is finished.

To compensate the first commit whose work is unknown, we add extra hours to the coding session.

Continue until we have determined all coding sessions and sum the hours made by individual authors.

The algorithm in ~30 lines of code.

Usage

In root of a git repository run:

$ git-hours

Note: repository is not detected if you are not in the root of repository!

Help

Usage: git-hours [options]

Options:

  -h, --help                                 output usage information
  -V, --version                              output the version number
  -d, --max-commit-diff [max-commit-diff]    maximum difference in minutes between commits counted to one session. Default: 120
  -a, --first-commit-add [first-commit-add]  how many minutes first commit of session should add to total. Default: 120
  -s, --since [since-certain-date]           Analyze data since certain date. [always|yesterday|tonight|lastweek|yyyy-mm-dd] Default: always'
  -e, --email [emailOther=emailMain]         Group person by email address. Default: none
  -u, --until [until-certain-date]           Analyze data until certain date. [always|yesterday|today|lastweek|thisweek|yyyy-mm-dd] Default: always
  -m, --merge-request [false|true]           Include merge requests into calculation.  Default: true
  -p, --path [git-repo]                      Git repository to analyze. Default: .
  -b, --branch [branch-name]                 Analyze only data on the specified branch. Default: all branches

Examples:

 - Estimate hours of project

     $ git-hours

 - Estimate hours in repository where developers commit more seldom: they might have 4h(240min) pause between commits

     $ git-hours --max-commit-diff 240

 - Estimate hours in repository where developer works 5 hours before first commit in day

     $ git-hours --first-commit-add 300

 - Estimate hours work in repository since yesterday

   $ git-hours --since yesterday

 - Estimate hours work in repository since 2015-01-31

   $ git-hours --since 2015-01-31

- Estimate hours work in repository on the "master" branch

   $ git-hours --branch master

For more details, visit https://github.com/qgustavor/git-hours