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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chainsafe/github-analytics

v1.2.0

Published

A tool to create Github issues and pull request analytics

Downloads

21

Readme

Github Analytics

This is a tool to collect various Gtihub Analytics not currently tracked by GithHub. Some of the things you could analyze are response times (time till first comment/review) for new issues and pull requests, the time required to merge PRs, and statistics on community-opened issues and pull requests. It is useful to measure the productivity and health of your team as well as community support and usage.

Many thanks to shibayu36 who created the initial implementation for pull request stats.

Installation

npm install -g @chainsafe/github-analytics
yarn global add @chainsafe/github-analytics

Usage

To use this tool, you will need to obtain Github Personal Access Token (PAT) which you can do by following Github's instructions. The minimum required permissions are: repo(repo:status, public_repo), read:org, read:discussions.

Issues stats

The following command aggregates Issues of web3.js and web3.js-chainlink-plugin which merged between --start and --end. You can additionally filter Issues by the --query option. See also https://docs.github.com/en/github/searching-for-information-on-github/searching-issues-and-pull-requests if you want to know what you can specify for --query

GITHUB_TOKEN=... ga issues stat --start="2023-01-01T00:00:00" --end="2023-02-01" --query="repo:web3/web3.js repo:chainsafe/web3.js-plugin-chainlink" --teamMembers=avkos,jdevcs,luu-alex,mconnelly8,Muhammad-Altabba,nikoulai,spacesailor24 --human

output is

{
 "issues": {
    "issueCount": "30 issues",
    "externalIssueCount": "11 issues",
    "externalIssueClosedCount": "4 issues",
    "responseTimeAverage": "2 weeks, 17 hours, 54 minutes, 51.9395454545021 seconds", //only external issues
    "responseTimeMedian": "6 days, 8 hours, 33 minutes, 1 second", //only external issues
    "timeToCloseAverage": "1 week, 4 days, 4 hours, 28 minutes, 55.75 seconds", //only external issues
    "timeToCloseMedian": "1 week, 2 days, 22 hours, 45 minutes, 30.5 seconds" //only external issues
  }
}
  • response time: diff between an Issue created and the first comment by a team member
  • timeToClose: diff between an Issue created and an Issue closed

log command

If you want to get raw information about PullRequests, you can use a pr log command.

PullRequest stats

The following command aggregates PullRequests of web3.js and web3.js-chainlink-plugin which merged between --start and --end. You can additionally filter PullRequests by the --query option. See also https://docs.github.com/en/github/searching-for-information-on-github/searching-issues-and-pull-requests if you want to know what you can specify for --query

GITHUB_TOKEN=... ga pr stat --start="2023-01-01T00:00:00" --end="2023-02-01" --query="repo:web3/web3.js repo:chainsafe/web3.js-plugin-chainlink" --teamMembers=avkos,jdevcs,luu-alex,mconnelly8,Muhammad-Altabba,nikoulai,spacesailor24 --human

output is

{
  "pull_request": {
    "pullRequestCount": "34 pull requests",
    "externalPullRequestCount": "6 pull requests",
    "additionsAverage": "618 lines",
    "additionsMedian": "115 lines",
    "deletionsAverage": "1328 lines",
    "deletionsMedian": "25 lines",
    "leadTimeAverage": "5 days, 13 hours, 16 minutes, 12 seconds",
    "leadTimeMedian": "3 days, 5 hours, 50 minutes, 15 seconds",
    "timeToMergeAverage": "4 days, 22 hours, 51 minutes, 14 seconds",
    "timeToMergeMedian": "2 days, 7 hours, 17 minutes, 5 seconds",
    "timeToMergeFromFirstReviewAverage": "3 days, 4 hours, 58 minutes, 49 seconds",
    "timeToMergeFromFirstReviewMedian": "1 day, 7 hours, 14 minutes, 14 seconds",
    "responseTimeAverage": "2 days, 12 hours, 55 minutes, 59 seconds"
  }
}
  • leadTime: diff between a first commit and a PullRequest merged date
  • timeToMerge: diff between a PullRequest created and a PullRequest merged
  • timeToMergeFromFirstReview: diff between a first review and a PullRequest merged.

If you want to know about leadTime and timeToMerge for details, See https://sourcelevel.io/blog/5-metrics-engineering-managers-can-extract-from-pull-requests

|------------- lead time ---------------------------------|
                |--- response time ---|
                |---------- time to merge ----------------|
-----------------------------------------------------------
^               ^                     ^                   ^
first commit    create PullRequest    first review        PullRequest merged

log command

If you want to get raw information about PullRequests, you can use ga pr log command.