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

arcade-game-element

v1.0.2

Published

A web component for embedding classic arcade games.

Readme

Arcade Game Element

A web component to embed classic arcade games into your website.

Installation

npm install arcade-game-element

Usage

  1. Import the component:

    In your HTML file, add the following script tag:

    <script type="module" src="node_modules/arcade-game-element/ArcadeGame.js"></script>
  2. Use the custom element:

    Add the <arcade-game> element to your HTML, specifying the game you want to load with the game attribute.

    <arcade-game game="space-shooter"></arcade-game>

Attributes

  • game (required): The name of the game to load. Currently, only "space-shooter" is available.
  • mode: The mode to run the game in.
    • "engine" (default): Runs the standard game engine.
    • "god": Runs the game in "God Mode" with debugging features enabled.

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Arcade Game</title>
    <script type="module" src="node_modules/arcade-game-element/ArcadeGame.js"></script>
    <style>
        body {
            margin: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <arcade-game game="space-shooter" mode="god"></arcade-game>
</body>
</html>

TypeScript / TSX Usage

This package includes TypeScript declaration files (.d.ts) to provide type safety and autocompletion when used in TypeScript or TSX projects.

In your TSX/React Component:

You can import and use the custom element directly. Ensure the component is loaded globally (e.g., via a <script type="module"> tag in your index.html or by importing it in your main application entry point).

import React from 'react';
// Ensure the custom element is registered, typically done in your main.tsx or index.html
import 'arcade-game-element/ArcadeGame.js'; 

const MyGameComponent: React.FC = () => {
  return (
    <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', minHeight: '100vh', backgroundColor: '#0F172A' }}>
      <arcade-game game="space-shooter" mode="engine"></arcade-game>
    </div>
  );
};

export default MyGameComponent;

Type Declarations for JSX/TSX:

Because this is a custom web component, you might need to ensure your TypeScript compiler knows about it, especially in React projects. The included ArcadeGame.d.ts handles this for most setups. If you encounter type errors like Property 'arcade-game' does not exist on type 'JSX.IntrinsicElements', ensure your tsconfig.json correctly includes the declaration file, or explicitly add it.

Example tsconfig.json (ensure include covers your node_modules or has typeRoots configured):

{
  "compilerOptions": {
    // ... other options
    "jsx": "react-jsx", // or "react"
    "types": ["node"], // or other types you use
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/arcade-game-element" // Add this if needed
    ]
  },
  "include": [
    "src",
    "node_modules/arcade-game-element" // Ensure declarations are included
  ]
}

By default, if you install the package, TypeScript should automatically pick up the ArcadeGame.d.ts file.

Development

To run the game locally, you will need a local web server.

  1. Clone the repository.
  2. Run npm install.
  3. Run a local web server. For example, using http-server:
    npx http-server
  4. Open your browser and navigate to the server address (e.g., http://localhost:8080).