Mokkapps Logo

My First NPM Package: github-traffic-cli

Michael Hoffmann (Mokkapps) - Senior Frontend Developer (Freelancer)
May 12, 2018
1 Minuten Lesezeit
|
- Ansichten
Development
My First NPM Package: github-traffic-cli Image

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 stumbled 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:

"github-traffic-cli" Screenshot
"github-traffic-cli" Screenshot

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.

Sie haben einen Fehler in diesem Artikel gefunden? Sie möchten gerne etwas klarstellen, aktualisieren oder hinzufügen?

Alle meine Artikel können auf Github editiert werden. Jeder Fix ist willkommen, egal wie klein er sein mag!

Ändern auf Github
Wenn Sie diesen Artikel hilfreich fanden. Werden Sie diese diese lieben.
How to Create a Custom Code Block With Nuxt Content v2 Image

June 16, 2022

Gelesen
How to Create a Custom Code Block With Nuxt Content v2
Create a Blog With Nuxt Content v2 Image

June 02, 2022

Gelesen
Create a Blog With Nuxt Content v2
Chrome Recorder: Record, Replay and Measure User Flows Image

April 28, 2022

Gelesen
Chrome Recorder: Record, Replay and Measure User Flows
Dark Mode Switch With Tailwind CSS & Nuxt 3 Image

February 21, 2022

Gelesen
Dark Mode Switch With Tailwind CSS & Nuxt 3