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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@play-room/quizz

v0.1.2

Published

Smart quizz game with multiple categories and languages, powered by PlayRoom

Readme

@play-room/quizz

Standalone quizz game package. It can run by itself or be registered inside PlayRoom core.

What It Includes

  • multi-step start flow
  • category and question-language support
  • global answers key support
  • credits and leaderboard persistence
  • built-in light and dark themes
  • configurable primary and secondary brand colors
  • built-in UI localization with en and sr
  • optional external control of UI locale and theme

Install

npm install @play-room/quizz

Default Data Sources

  • Questions: https://raw.githubusercontent.com/Play-Room/data/refs/heads/main/quizz/technology/en.json
  • Answers: https://raw.githubusercontent.com/Play-Room/data/refs/heads/main/quizz/answers.json

By default, answers are loaded from the single global answers.json file for all categories and languages.

Standalone Usage

import { createQuizzApp } from "@play-room/quizz";

const app = createQuizzApp({
  questionsUrlPattern:
    "https://raw.githubusercontent.com/Play-Room/data/refs/heads/main/quizz/{category}/{language}.json",
  answersUrl: "https://raw.githubusercontent.com/Play-Room/data/refs/heads/main/quizz/answers.json",
  categories: {
    technology: "Technology",
    science: "Science",
    sports: "Sports"
  },
  languages: {
    en: "English",
    sr: "Српски"
  },
  defaultCategory: "technology",
  defaultLanguage: "en",
  limit: 5,
  randomizeQuestions: true,
  persistPlayerByClient: true,
  themeColors: {
    primary: "#0f766e",
    secondary: "#14b8a6"
  },
  locale: "en",
  showLocaleSwitcher: true,
  theme: "light",
  showThemeSwitcher: true
});

await app.mount(document.getElementById("app")!);

Theme Colors

Use themeColors.primary and themeColors.secondary to adapt the package to the host dashboard color system.

createQuizzApp({
  themeColors: {
    primary: "#1d4ed8",
    secondary: "#2563eb"
  }
});

These colors are applied in both light and dark mode.

UI Localization

The package ships with built-in UI locales:

  • en
  • sr

Use locale for a fixed language:

createQuizzApp({
  locale: "sr"
});

Show the built-in locale selector in the header:

createQuizzApp({
  locale: "en",
  showLocaleSwitcher: true
});

External Locale Control

Use getLocale and onLocaleChange when the host app owns the locale state.

let currentLocale = "en";

const app = createQuizzApp({
  getLocale: () => currentLocale,
  onLocaleChange: (nextLocale) => {
    currentLocale = nextLocale;
  },
  showLocaleSwitcher: true
});

External Theme Control

Use theme, getTheme, and onThemeChange when the host app owns theme state.

let currentTheme = "dark";

const app = createQuizzApp({
  getTheme: () => currentTheme,
  onThemeChange: (nextTheme) => {
    currentTheme = nextTheme;
  },
  showThemeSwitcher: true
});

Set showThemeSwitcher: false if the dashboard already provides its own theme toggle.

Progress Persistence

By default, credits and leaderboard data are stored in IndexedDB with IndexedDbQuizzProgressService.

Override it if you need custom persistence:

import { createQuizzApp, QuizzProgressService } from "@play-room/quizz";

class CustomProgressService implements QuizzProgressService {
  async getCredits(playerName: string) { return 0; }
  async addCredits(playerName: string, amount: number) { return amount; }
  async addLeaderboardEntry(entry) {}
  async getLeaderboard(limit = 20) { return []; }
}

createQuizzApp({
  progressService: new CustomProgressService()
});

Custom Question and Answer Sources

import { createQuizzApp, QuizzContentService } from "@play-room/quizz";

class CustomQuizzService implements QuizzContentService {
  async loadQuestions(options) {
    const category = options?.category ?? "technology";
    const language = options?.language ?? "en";
    const response = await fetch(`/api/quizz/${category}/${language}`);
    return response.json();
  }

  async loadAnswerKey() {
    const response = await fetch("/api/quizz/answers");
    return response.json();
  }
}

createQuizzApp({
  contentService: new CustomQuizzService()
});

Optional PlayRoom Integration

import { PlayRoom } from "@play-room/core";
import { createQuizzMetadataDefinition } from "@play-room/quizz";

const hub = new PlayRoom();

hub.registerGame({
  game: createQuizzMetadataDefinition(),
  config: {
    questionsUrlPattern: "https://example.com/quizz/{category}/{language}.json",
    answersUrl: "https://example.com/quizz/answers.json",
    categories: {
      technology: "Technology",
      science: "Science"
    },
    languages: {
      en: "English",
      sr: "Српски"
    },
    locale: "en",
    showLocaleSwitcher: true,
    showThemeSwitcher: true
  }
});