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

counted

v0.0.1

Published

Capture, store and track download_count values for assets distributed via Github Releases

Downloads

13

Readme

counted

The missing analytics feature for GitHub Releases.

Why?

The GitHub Releases API provides only a point-in-time snapshot of the download_count property for each asset.

What?

This repository contains a script to fetch the download_count value for all release assets in a given repository and store that data in a number of per-release JSON files in that same repository.

By default it will store these files in its own counted directory on a counted branch.

$ cd myrepo
$ git pull
$ git checkout counted
$ ls -1 counted
release-1234567.json
release-1234568.json
release-1234569.json
...
$ cat release-1234567.json
{
  "7654321": {
    "2018-01-01T00:00:24Z": 7,
    "2018-01-02T00:00:41Z": 12,
    "2018-01-03T00:00:44Z": 23,
...

In this example 1234567 is the release id and 7654321 is the asset id.

This script can be run at any desired frequency, typically daily. The more often it is run, the more accurate data interpolation can be.

How?

First you'll need to create a counted branch on your repository.

Create a branch on GitHub

Then Heroku Scheduler can be used to run this script for free.

Deploy

  1. Click the Deploy to Heroku button above.
  2. Enter a unique-to-Heroku App name.
  3. Choose a region, one of US or Europe.
  4. Fill in the Config Variables with the values for your GitHub repository.
    • GITHUB_OWNER: GitHub username that owns the repository, e.g. lovell.
    • GITHUB_REPO: Name of the repository, e.g. counted.
    • GITHUB_AUTH_TOKEN: GitHub Personal Access Token granted public_repo scope access.
    • REPO_BRANCH: Git branch to use for commits, default value is counted.
    • REPO_DIRECTORY: Directory to use to store data, default value is counted.
    • COMMITTER_NAME: Git user.name for this task to commit as, default value is counted.
    • COMMITTER_EMAIL: Git user.email for this task to commit as, default value is [email protected].
  5. Click Deploy app and wait for the Your app was successfully deployed message.
  6. Click Manage App.
  7. Click Heroku Scheduler under Add-ons.
  8. Click Add new job and enter the following details: Heroku Scheduler
    • $: npm start
    • Frequency: Daily
    • Next due: 00:00
  9. Click Save.

TODO

  • Interpolation of timestamped download_count values
  • Pretty reports

Licence

Copyright 2018 Lovell Fuller.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.