This is a command line tool written in Node.js that interacts with the "icanhazdadjoke" API to fetch and save jokes. It includes a leaderboard feature to display the most popular joke stored in the jokes.txt file.
To use the tool, follow these steps:
- Clone the repository.
- Install dependencies using
npm install
. - Run the tool using
node index.js [searchTerm]
ornode index.js leaderboard
for the leaderboard feature.
[searchTerm]
: Specify a search term to find jokes.leaderboard
: Display the most popular joke in the jokes.txt file.
# Search for jokes with the term "friend"
$ node index.js friend
# Display the leaderboard
$ node index.js leaderboard