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

flashtap

v0.1.9

Published

FlashTap Game Library

Readme

FlashTap Game Library

FlashTap is a reusable React component library for the FlashTap game, designed to be easily embedded into existing React Single Page Applications (SPAs).

Installation

npm install flashtap
# or
yarn add flashtap

Basic Usage

To embed the full game experience with the default UI and settings, simply import the FlashTapGame component and render it.

import { FlashTapGame } from 'flashtap';

function App() {
  return (
    <div style={{ height: '100vh', width: '100%' }}>
      <FlashTapGame />
    </div>
  );
}

The FlashTapGame component is responsive and will adapt to the container size.

Custom Integration

If you need to wrap the game in your own layout (e.g., inside a dashboard, or with custom surrounding controls) but still want to use the standard game visualization, you can combine the useGameLogic hook with the GameArea component.

This allows you to manage the configuration and container while delegating the complex game rendering to the library.

Example: Custom Wrapper

import { useGameLogic, GameArea, GameConfig } from 'flashtap';

function CustomGameWrapper() {
  // 1. Define configuration
  const config: GameConfig = {
    mode: 'matching', // 'matching' | 'ordering' | 'mixed'
    answerCount: 4,
    attempts: 0 // 0 = Sudden Death
  };

  // 2. Initialize logic
  const {
    gameState,
    handleOptionClick,
    loadRound
  } = useGameLogic(config);

  return (
    <div className="my-custom-container" style={{ height: '600px', border: '2px solid #333' }}>
      <header className="custom-header">
         <h2>My Custom Game Header</h2>
      </header>

      {/* 3. Render the GameArea with state from the hook */}
      <GameArea
        gameState={gameState}
        onOptionClick={handleOptionClick}
        onNextRound={loadRound}
      />
    </div>
  );
}

Types

The library exports TypeScript types to help with integration:

  • GameConfig: Configuration for the game (mode, difficulty, etc.)
  • GameState: Current state of the game (playing, success, failure, etc.)
  • GameMode: Enum for game modes.

Styling

The library uses Tailwind CSS internally. If you are using the pre-built components (FlashTapGame or GameArea), ensure your project handles the CSS (or import the dist styles if provided, typically import 'flashtap/dist/style.css' depending on build setup).