DEV Community

Michael Hoffmann
Michael Hoffmann

Posted on • Edited on

7 5

My First NPM Package: github-traffic-cli

Since I published my first projects on GitHub I really enjoyed viewing the traffic on my repositories. It is really interesting to see how many people visit or clone my repositories.

Unfortunately it costs a lot of time to click through all available repositories and I was looking for a more elegant way.

I stumpled upon the npm package github-traffic which already provides an API to fetch the GitHub traffic. So I decided to write a command line interface (CLI) npm package which uses this API.

As a result I can check the traffic on all of my repositories with one CLI command:

Develop & publish npm package

The process is very easy and documented in the npm docs.

Used npm packages

  • chalk: Terminal string styling done right
  • clui: Node.js toolkit for quickly building nice looking command line interfaces
  • commander: The complete solution for node.js command-line interfaces
  • figlet: Terminal ASCII art from text
  • inquirer: A collection of common interactive command line user interfaces.

Links

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay