Blog

1 Minuten Lesezeit

My First NPM Package: github-traffic-cli

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

KI-Assistent fragen
Michael Hoffmann

Michael Hoffmann

@mokkapps

My First NPM Package: github-traffic-cli Image

Since I published my first projects on GitHub I've enjoyed viewing the traffic on my repositories. It is exciting 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

Develop & publish npm package

The process is straightforward 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.
Wenn du diesen Artikel hilfreich fandest.Wirst du diese lieben.
A Comprehensive Guide to Data Fetching in Nuxt 3 Image

A Comprehensive Guide to Data Fetching in Nuxt 3

How to Add an AI Chatbot to Your Nuxt Website with Aiduko Image

How to Add an AI Chatbot to Your Nuxt Website with Aiduko

Analyze Memory Leaks in Your Nuxt App Image

Analyze Memory Leaks in Your Nuxt App

Build and Deploy a Serverless GraphQL React App Using AWS Amplify Image

Build and Deploy a Serverless GraphQL React App Using AWS Amplify