Fetch and print public details for a GitHub user.
You are required to build a CLI tool using Node.js that prints public profile details for a GitHub user.
The tool should accept a GitHub username from the terminal. If the user does not pass a username, it should print a friendly error.
Here are some example commands you can run to test your CLI:
On successful execution, the output should look like this:
The exact follower count can be different when you run the command.
If the GitHub user does not exist, print a friendly error:
If the user does not pass a username, print this error:
Errors should go to stderr, and the command should set a non-zero exit code.
The goal of this project is to practice reading command arguments, calling an API from Node.js, handling failed responses, and printing useful data in the terminal.
You will need these Node.js APIs:
process.argv to read the username from the terminal.
fetch to call the GitHub API.
encodeURIComponent() to safely place the username in the URL.
Join the Community
roadmap.sh is the most starred project on GitHub and is visited by hundreds of thousands of developers every month.
Roadmaps Best Practices Guides Videos FAQs YouTube
roadmap.sh by @kamrify @kamrify
Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.
Login or Signup
You must be logged in to perform this action.