Catalog npm
Back to packageRELEASE DETAILS

0.1.0

npm

404game

Turn boring 404 pages into playable mini-games. Drop-in JS library with snake, flappy, breakout, and dino runner. Zero dependencies.

404breakoutbrowser-gamecanvasdinoeaster-eggembedflappygamelibrarymini-gamesnaketypescriptzero-dependencies
Published29 May 2026
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

404game.js

Turn boring 404 pages into playable mini-games. Drop-in, zero dependencies, < 30KB.

🎮 Live Demo →

<script src="404game.js"></script>
<div id="game"></div>
<script>Game404.mount('#game');</script>

That's it. Your 404 page now has Snake, Flappy Bird, Breakout, or a Dino runner.


🎮 Games included

GameControls (Desktop)Controls (Mobile)
🐍 SnakeArrow keysSwipe
🐦 FlappySpace / ClickTap
🧱 BreakoutArrow keys + SpaceSwipe + Tap
🦖 DinoSpaceTap

Plus 4 themes: neon, retro, minimal, dark.


📦 Install

npm install 404game

or use the CDN-style UMD bundle:

<script src="https://unpkg.com/404game/dist/404game.umd.cjs"></script>

🚀 Usage

Vanilla / <script> tag

<div id="game"></div>
<script src="404game.umd.cjs"></script>
<script>
  Game404.mount('#game', {
    game: 'random',   // 'snake' | 'flappy' | 'breakout' | 'dino' | 'random'
    theme: 'neon',    // 'neon'  | 'retro'  | 'minimal'  | 'dark'
  });
</script>

ES Modules / bundlers

import Game404 from '404game';

Game404.mount('#game', { game: 'snake' });

React

import { useEffect, useRef } from 'react';
import Game404 from '404game';

function NotFoundPage() {
  const ref = useRef(null);
  useEffect(() => {
    const instance = Game404.mount(ref.current, { game: 'random' });
    return () => instance.destroy();
  }, []);
  return <div ref={ref} />;
}

⚙️ Options

OptionTypeDefaultDescription
game'snake' | 'flappy' | 'breakout' | 'dino' | 'random''random'Which game to load
theme'neon' | 'retro' | 'minimal' | 'dark''neon'Visual theme
widthnumbercontainer width or 480Canvas width (px)
heightnumber360Canvas height (px)
messagestring'404 — Page Not Found'Big banner text
subMessagestring'But hey, want to play instead?'Small banner text
showHighscorebooleantrueShow "Best" score in HUD
autoStartbooleanfalseSkip start screen
onStart() => void—Fired when player starts
onScore(score: number) => void—Fired on every score update
onGameOver(score: number) => void—Fired when player loses
onWin(score: number) => void—Fired when player wins (Breakout)

🔧 API

const instance = Game404.mount(selector, options);

instance.restart();        // Restart current game
instance.getScore();       // Current score
instance.destroy();        // Remove from DOM, free resources

Game404.unmount(selector); // Same as instance.destroy()

Game404.games;             // ['snake', 'flappy', 'breakout', 'dino']
Game404.version;           // '0.1.0'

✨ Features

  • 🎮 4 classic games built in
  • 🎨 4 themes included
  • 📱 Touch + keyboard controls — works everywhere
  • 💾 Local high scores per game
  • 🪶 Zero dependencies — pure browser APIs
  • 📦 < 30KB minified + gzipped
  • 🧩 TypeScript types included
  • ♻️ Auto-cleanup with destroy()
  • 🎯 Framework-friendly (React, Vue, Svelte, vanilla, anywhere)

🛠️ Development

npm install
npm run dev        # Vite dev server at http://localhost:5173
npm run build      # Build to dist/
npm run preview    # Preview built demo at http://localhost:4173

Open demo/index.html after building to see all 4 games at once. Open demo/404.html to see a real-world 404 page integration.


📄 License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.6.0development
vite
Environment
{
  "local_name": "vite",
  "alias": false,
  "peer_metadata": null
}
^5.4.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-IKKiec2l5rL9fgFVEENTcD6gA2F2dc0UQEweyCsTPF4j+WddHOyW+7IS+Jaee2CS4/7IxxYcOWs/gQEU+EOBOQ==",
  "shasum": "3ec19ac980b3d686f486a1c30e7e23fbcc38529b",
  "tarball": "https://registry.npmjs.org/404game/-/404game-0.1.0.tgz",
  "fileCount": 19,
  "unpackedSize": 180867,
  "signatures": [
    {
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
      "sig": "MEQCICwRZIMp/0pNY61wfkOY9kLrGO5Q37pRMsDxl+BWqxe1AiB3bkcfbXILDCvGxAMQOotwYv2iuq/u7w1ykP3FX4GK8A=="
    }
  ]
}

Repository

ACCESSIBLE
x1n-q/404game

Shared repository data · GitHub

License detected in repository
MIT
License branch / ref
main
Last push
29 May 2026
Archived
No
Contributor identities
— · partial collection

Public sponsor counts have not been collected. These signals belong to the repository owner.

Downloads & popularity

0count
Gauge · observed snapshots23 Oct 2026
10.50
2026-10-23: 0 · observed 2026-10-23T08:00:25.5819657Z
23 Oct23 Oct

github · 1 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2302026-10-23T08:00:25.5819657Z

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:58 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c2d7dce8f1500e44a06b329b397e5e2436697f14d5a000b32d95f37af2aa5d6e

Other collected versions

View all collected versions →