This Node.js application allows users to search for jokes based on a provided search term and tracks user responses to jokes, creating a leaderboard of the most liked jokes.
- Node.js installed on your machine
-
Clone the repository to your local machine:
git clone <repository-url>
-
Navigate to the project directory:
cd <project-directory>
-
Install dependencies:
npm install
-
Run the application:
node <filename.js> <operation> <search-term>
<filename.js>
: The name of the JavaScript file (e.g.,index.js
).<operation>
: UsesearchTerm
to search for jokes orleaderBoard
to view the leaderboard.<search-term>
: The word to search for jokes (applicable only for thesearchTerm
operation).
To search for jokes based on a specific term:
node index.js searchTerm <word>
Replace <word>
with the term you want to search for jokes.
To view the leaderboard of the most liked jokes:
node index.js leaderBoard
After each displayed joke, the application prompts the user to provide feedback by answering whether they liked the joke. The feedback is recorded, and the leaderboard is updated accordingly.