npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cli-quiz-tool

v1.0.0

Published

An interactive TypeScript quiz game featuring 100 Q&A with various difficulty levels, designed to help everyone prepare effectively for TypeScript tests.

Downloads

5

Readme

Ultimate TypeScript Quiz

Welcome to the Ultimate TypeScript Quiz! This application is designed to test your knowledge of TypeScript across three levels: Basic, Intermediate, and Advanced. Answer questions correctly to progress through the levels and see how much you know about TypeScript.

This quiz covers a wide range of TypeScript concepts from basic to advanced levels.

[x] To ensure a manageable level of complexity for learners, I have selected and provided 45 questions out of the original 100 MCQs. For example, you can practice topics such as

Basic Level (Questions 1-15):

  • Covers fundamental TypeScript concepts like primitive types, variables, functions, classes, and modules.

Intermediate Level (Questions 16-30):

  • Introduces more advanced topics like interfaces, decorators, generics, type aliases, and utility types.

Advanced Level (Questions 31-45):

  • Delves into deeper concepts like mapped types, discriminated unions, async/await, advanced utility types, and working with objects, functions in a type-safe manner and Advanced TypeScript Concepts as you see fit.

Table of Contents

Introduction

The Ultimate TypeScript Quiz is an interactive command-line application that provides a fun and educational way to test and improve your TypeScript knowledge. The quiz consists of 100 questions divided into three difficulty levels. Players start at the Basic level and can progress to Intermediate and Advanced levels by correctly answering questions.

Features

  • Multiple Levels: The quiz has three levels of difficulty: Basic, Intermediate, and Advanced.
  • Randomized Questions: Questions are shuffled each time you play to ensure a unique experience.
  • Timed Quiz: You have a limited time to complete the quiz, adding an extra challenge.
  • Score Tracking: Your score is tracked and displayed at the end of the quiz.
  • Restart Option: You can choose to play again after completing the quiz.
  • Error Handling: Graceful error handling to ensure a smooth user experience.

Installation

To install and run the Ultimate TypeScript Quiz, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/your-username/ultimate-typescript-quiz.git
    cd ultimate-typescript-quiz
  2. Install Dependencies:

  3. Run the Quiz:

    npx 

Usage

After installing the dependencies, you can start the quiz by running npx. The quiz will display a welcome message and instructions. Answer the questions by selecting the correct option. Your score will be displayed at the end of the quiz, and you will have the option to restart the quiz if desired.

Quiz Levels

The quiz consists of three levels:

  1. Basic: This level tests fundamental knowledge of TypeScript.
  2. Intermediate: This level includes more challenging questions to test your deeper understanding.
  3. Advanced: This level is designed to test your expertise and advanced knowledge of TypeScript.

Players start at the Basic level and can progress to higher levels based on their performance.

Questions

The quiz includes 45 questions, each with four possible answers. Questions are categorized by level (Basic, Intermediate, Advanced). A correct answer earns points and helps the player progress to the next level.

Shuffle Function

  • The questions are shuffled using the lodash library to ensure a unique order each time the quiz is played. This randomness adds variety and replayability to the quiz.
function shuffleArray<T>(array: T[]): T[] {
    return _.shuffle(array);
}

Time Management

  • Players have a limited amount of time to complete the quiz. The elapsed time is tracked, and the quiz ends if the time limit is exceeded.
function getElapsedTimeInMinutes(startTime: Date): number {
    const currentTime = new Date();
    const elapsedTime = currentTime.getTime() - startTime.getTime();
    return Math.floor(elapsedTime / (1000 * 60));
}

Restart Option

  • After completing the quiz, players are given the option to restart and play again. This feature encourages replayability and allows players to improve their scores.
const { restart } = await inquirer.prompt([
    {
        type: 'confirm',
        name: 'restart',
        message: 'Do you want to play again?',
    },
]);

if (restart) {
    runQuiz();
} else {
    console.log(chalk.green("Thank you for playing! Goodbye."));
}

Error Handling

  • The quiz includes error handling to manage unexpected issues gracefully. This ensures a smooth user experience even if something goes wrong.

Contributing

  • Contributions are welcome! If you have any ideas for improvements or new features, feel free to open an issue or submit a pull request.

License


Name:- Hasnain Ahmed
Roll No:- 00310538
Quarter:- 1
Batch:- 1
City:- Karachi
Centre:- Sindh Governor House Karachi
Campus:- Main
Days/Time:- Wednesday 09:00 am - 12:00 pm