Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

GitHub CLI Project

A simple Node.js CLI tool to fetch and display recent GitHub user activity using the GitHub API. Project URL

Features

  • Fetches recent events for a GitHub user.
  • Displays details about:
    • Push events (number of commits pushed).
    • Issues opened.
    • Repositories starred.

Prerequisites

  • Node.js installed on your system.
  • A stable internet connection.

Installation

  1. Clone this repository:

    git clone https://github.com/your-username/github-cli-project.git
    
  2. Navigate to the project directory: cd github-cli-project

  3. Install dependencies (if any): npm install

Usage

  1. Run the script with a GitHub username as an argument: node index.js

Replace with the username of the GitHub user whose activity you want to fetch.

  1. Example: node index.js octocat

Output: Pushed 3 commits to octocat/Hello-World Opened a new issue in octocat/Hello-World Starred octocat/Hello-World

Error Handling . If the username is invalid or not found, the script will display: Error: User not found. Please check the username.

. For other errors, it will display the HTTP status code and message: Error: Error fetching data 500: Internal Server Error

Project Structure . index.js: Main script that fetches and processes GitHub user activity. Dependencies . node-fetch: Used to make HTTP requests to the GitHub API. Notes . The script uses the GitHub API's public endpoints, which may have rate limits. If you encounter rate limit errors, consider using a GitHub token for authentication.

License This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages