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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zalando/roadblock

v1.0.8

Published

node.js app to collect github data

Downloads

66

Readme

Roadblock

A Node.js application for collecting Github statistics into a SQLite or PostgreSQL database.

This project was built with simplicity and ease of use in mind. We simply wanted GitHub data in a relational database which we could then create visualisations for using Metabase (https://www.metabase.com/).

Installing and using

Install from npm as a global command

  > npm i @zalando/roadblock -g

Run the roadblock command in an empty folder

  > roadblock

This will generate a basic roadblock.json file which you can then modify:

{
    "github": {
        "token": "xxx",
        "url" : "https://internal.gith.ub/api/v3" 
    },
    "tasks": [
        "pre/*", "org/*", "repo/releases"
    ],
    "orgs": [
        "My-Org", "Second-org"
    ]
}

Github.token a github token is required to access most data - ensure that the token have read access to repo, repo:status, public_repo, read:org, read:user, read:discussion.

url is only required if you want to collect data from Github Enterprise.

Tasks Specify what data you want to collect, by default it is set to * which means run all possible tasks. Either use wildcards like * or org/* or set to specific tasks like repo/issues or ignore specific tasks with !repo/profiles

Orgs By default roadblock will attempt to collect from all orgs, which the token have access to, to filter or to query additional orgs, set them here.

Use either: * orgname or !orgname.

Configuration as arguments

Configuration values can also be passed from the command line to avoid storing tokens in clear text:

> roadblock github.token=YOURTOKEN

> roadblock orgs=["zalando","custom"]

Output

Script will run between 10 and 20 minutes and store collected data in a SQLite datase - you can also configure a postgres instance if needed.

Sqlite Database and json summaries will be stored in the folder where the roadblock is invoked.

Included tasks

The task system in roadblock divides the different data collection tasks into 4 seperate phases.

Pre

Tasks to collect initial data points, default is to collect configured organisations

  • pre/organisations - Collects available organisations from the user and configured orgs
  • pre/calendar - Creates a calendar table with years and months, helpful when querying data

Org

Tasks run for each seperate organisation, each task is passed an organisation object to process data based on.

  • org/members - collect all members of the organisations
  • org/repository - collect all public, non-fork repositories on the organisation
  • org/vulnerabilities - collect all security alerts from all repositories on the organisation

Repo

Tasks run for each collected repository.

  • repo/collaborators - Collect all collaborators on a repository
  • repo/commits - Collect all repository commits
  • repo/contributions - Collect all contributions (summarised changes)
  • repo/issues - Collect all issues on the repositories
  • repo/profiles - Repository health / community profile
  • repo/pullrequests - Repository pull requests
  • repo/releases - All releases on repository
  • repo/topics - Repository topics

Post

Tasks to run after all org and repo data collection is completed

  • post/export - Export organisation and repository stats to json files
  • post/upstream - Collect upstream contribution stats from external repositories.

Using the source

> Clone this project to your local machine
> git clone https://github.com/zalando-incubator/roadblock.git
> cd roadblock

> Run npm install and start collecting data
> npm install

Pre Requisites

What software you need to install:

  • Node.js
  • Metabase (optional) - to visualise the collected data

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE.md file for details