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

@norarcasey/tic-tac-nora

v0.1.0

Published

An embeddable React Tic Tac Nora game — play one vs computer, with an optimal (minimax) AI.

Readme

Tic Tac Nora 🎮

An embeddable React + TypeScript Tic Tac Toe component. Play one vs. computer — you're X, Nora (the computer) is O. Nora plays a random open square each turn, and the UI handles win / lose / draw out of the box.

Built with Vite and tested with Vitest + React Testing Library.

Quick start

npm install
npm run dev        # demo site at http://localhost:5173
npm test           # run the test suite
npm run build      # build the demo site for deployment
npm run build:lib  # build the embeddable component library

Embedding the component

import { TicTacNora } from 'tic-tac-nora'
import 'tic-tac-nora/style.css'

export function App() {
  return <TicTacNora />
}

Props

| Prop | Type | Default | Description | | ----------------- | ---------------------- | ---------------- | ---------------------------------------------------- | | difficulty | 'smart' \| 'random' | "smart" | How Nora plays — optimal minimax, or a random square.| | title | string | "Tic Tac Nora" | Heading shown above the board. | | className | string | — | Extra class on the root element. | | thinkingDelayMs | number | 450 | How long Nora "thinks" before moving (cosmetic). | | rng | () => number | Math.random | Injectable randomness — handy for deterministic play.|

How it works

  • src/game/logic.ts — pure, framework-free game logic: board creation, win/draw detection, and Nora's move pickers — a random one (pickRandomMove) and an optimal minimax one (pickBestMove). Fully unit-tested.
  • src/game/useTicTacNora.ts — a React hook that owns game state. Whose turn it is is derived from the board (you move on even mark counts, Nora on odd), so state stays minimal and self-correcting.
  • src/components/TicTacNora.tsx — the presentational, accessible component (ARIA grid, live status region, keyboard-friendly buttons).

Nora's brain

By default Nora plays optimally via minimax: she always takes an immediate win, always blocks yours, and never loses a game she could draw — so the best you can do against difficulty="smart" is force a draw. Pass difficulty="random" for the original beatable MVP behaviour. When several moves are equally optimal she breaks the tie randomly, so games still feel varied.

Roadmap

The move pickers are isolated in logic.ts, so adding a middle "medium" tier (e.g. mostly-optimal with the occasional random slip) would be a small, localized change.