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

gameloader-js

v1.2.1

Published

A plug-and-play gamified loading screen library. Let users play mini-games (dino runner, tetris, shooter, archery, snake, pacman, road fighter) while your content loads.

Readme

GameLoader.js

A plug-and-play, zero-dependency JavaScript library that turns boring loading screens into playable mini-games. Pure vanilla JS + Canvas 2D — no images, no frameworks, no CSS conflicts (rendered inside Shadow DOM).

The integrating developer configures one game; users play it while your content loads.

Games

| id | Game | Controls (desktop) | Controls (touch) | |-----------|-------------|------------------------------------------|-----------------------------------------| | dino | Dino Runner | Space/↑ jump, ↓ duck | Tap to jump | | tetris | Tetris | ←→ move, ↑ rotate, ↓ soft drop, Space hard drop | Tap sides/middle, swipe down | | shooter | Shooter | ←→/A-D move, Space shoot | Drag to move (auto-fire) | | archery | Archery | Hold Space to draw, release to shoot, ↑↓ aim | Hold to draw, release to shoot | | snake | Snake | Arrows/WASD to steer | Swipe to turn | | pacman | Pacman | Arrows/WASD to steer | Swipe to turn | | roadfighter | Road Fighter | ←→ steer, ↑ accelerate, ↓ brake | Drag to steer (auto-accelerate) | | crossword | Crossword | Click cell + type, Space = row/col | Tap cell + on-screen keyboard |

Install

CDN (script tag, UMD):

<script src="https://cdn.jsdelivr.net/npm/gameloader-js/dist/gameloader.umd.min.js"></script>
<script>
  const loader = GameLoader.init({ game: 'dino' });
  loader.show();
</script>

npm:

npm install gameloader-js
import GameLoader from 'gameloader-js';
const loader = GameLoader.init({ game: 'tetris' });

Self-hosted: copy dist/gameloader.umd.min.js (or the .esm build) into your assets and reference it directly.

Usage

const loader = GameLoader.init({
  game: 'dino',              // REQUIRED: 'dino' | 'tetris' | 'shooter' | 'archery' | 'snake' | 'pacman' | 'roadfighter' | 'crossword'
  container: document.body,  // optional: element to mount in (default: fullscreen)
  message: 'Loading...',     // optional: heading text
  showProgress: true,        // optional: progress bar (indeterminate until setProgress)
  highScores: true,          // optional: persist best score in localStorage
  minDisplayTime: 1000,      // optional: min ms visible (avoids flash on fast loads)
  theme: {                   // optional: partial overrides
    bg: '#101418',           // overlay background
    canvasBg: '#0a0d10',     // game canvas background
    text: '#e8e8e8',
    accent: '#35d07f',       // ship/dino/bow/progress color
    danger: '#ff5a5a',       // enemies/obstacles/target color
  },
});

loader.show();               // display the loader
loader.setProgress(42);      // 0-100; switches bar from indeterminate to determinate
loader.setMessage('Almost there...');
await loader.hide();         // fade out + cleanup (respects minDisplayTime)

Promise wrapper

// Shows the loader, hides automatically when the promise settles.
const data = await GameLoader.wrap(fetch('/api/data'), { game: 'shooter' });

Notes

  • GameLoader.games lists valid game ids.
  • Passing an invalid/missing game throws with the list of valid options.
  • When using a custom container, give it position: relative — the overlay is absolutely positioned inside it.
  • The game box auto-scales (aspect ratio preserved) to fit the container or viewport, and re-fits on resize — tall games work in short containers.
  • All styles live in Shadow DOM; your site's CSS is never affected.
  • Works on desktop and mobile: every game has both keyboard and touch controls (crossword ships its own on-screen keyboard).

Development

npm install
npm run build     # builds dist/ (UMD + ESM, minified variants)
npm run serve     # serve repo root, open http://localhost:8080/demo/

test.html in the repo root is an interactive test bench covering every config option, the promise wrapper, and error handling.

Changelog

1.2.1

  • Crossword UX: how-to-play intro, pre-filled starter letters, always-visible row+column clues, HINT key (3 per puzzle), blinking cursor

1.2.0

  • New game: crossword (word-square puzzles, on-screen keyboard for touch)

1.1.0

  • New games: snake, pacman, roadfighter
  • Overlay auto-scales the game box to fit small containers / short viewports
  • Fixes: road fighter speed cap, overlapping spawns, traffic cleanup while braking; pacman ghost-farming exploit

1.0.1

  • Fixes: hide() re-entrancy crash, NaN touch coordinates on touchend, restart double-firing game actions, unreachable bird hitbox in dino, unbounded array growth in archery

1.0.0

  • Initial release: dino, tetris, shooter, archery; progress bar, theming, high scores, promise wrapper, Shadow DOM isolation

License

MIT