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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tknight-dev/gaming-canvas

v1.18.4

Published

A better/faster way to start writing games

Downloads

191

Readme

Gaming Canvas · GitHub license

Logo

Supports

Why This Library?

GamingCanvas is for the game developer that wants to write their own game or engine, their own way, rather than usings solutions like PixiJs and Phaser. It provides the following to get you up and running:

  • Audio: The built in audio system provides buffers which allow you to play multiple audio files at the same time (even the same audio file)
    • Update the pan and volume of the effect or music depending on your game's environment!
    • Use faders to automatically evolve your pan and volume values to your desired settings over a duration of milliseconds
      • Use fader callback chaining to perfectly time more complicated pan and volume changes over a series of actions
  • DPI: Supports high/low DPI screens (devicePixelRatio)
  • Fullscreen: Quickly fullscreen your game
  • Inputs: Gives you access to Gamepad, Keyboard, Mouse, and Touch via a serialized (FIFO) input queues
    • Enable or disable any input type you want
    • Gamepad: Support currently excludes triggers due to different browser bugs/implementations of the Gamepad API
    • Mouse: Supports left, right, and wheel based inputs
    • Touch: Supports as many individual inputs as your screen can support
  • Layers: Specify how many layers you want to optimize your game for. It can generate multiple canvases for background, foreground, overlay-1, etc, etc
    • Send each layer to a different WebWorker to dedicate a thread to each canvas element (massive performance gains) (multithreading)
  • Lists: Provides List implementions where Array performance faulters
    • Double-Linked-List
    • FIFO Queue (Single-Linked-List without popEnd() or pushStart())
  • Lightweight: Core library is ~45kb
  • Modules
    • Grids: Includes Grid, Camera, Path Finding (A*), Raycasting, and Viewport implementations. See How-To > Module: Grids for all the features and details
  • Mobile: Mobile devices are fully supported
  • Orientation: Auto rotate for maximum screen usage or lock it to a specific orientation (Portrait/Landscape)
  • Resolution: Use a fixed resolution to optimize your FPS (it still scales to fill the screen like a regular video game would)
    • Dimensions are always rounded down to the nearest pixel to improve performance
    • Scaling uses the css transform: scale(x) function which your browser (CPU) offloads to your GPU (best performance)
    • Use the aspectRatio option to lock your display to something like 1 / 1 , 4 / 3, and 16 / 9 (the default)
  • Splitscreen: A no hassle way to split your screen for 2 players (2 canvases sharing the space of 1 canvas)
  • Vibration: Set vibration (think mobile device vibration during an incoming phone call) for single use or repeating patterns
    • Not supported by all browsers (MDN)
  • Visibility: Quickly know if your game needs to be paused (browser minimized or switched to new tab)
  • Wake Lock: Quickly prevent mobile devices from dimming the screen while you're playing

See the GamingCanvas in action in the following games:

  • Life, A multithreaded Conway's Game of Life for Desktop and Mobile devices (supports Gamepad, Keyboard, Mouse, and Touch based inputs) [GitHub]
  • Wolfenstein3D, A multithreaded (+Multiplayer) rewrite of Id Software's 1992 release (supports Gamepad, Keyboard, Mouse, and Touch based inputs) [GitHub]

Documentation

Link: Documentation

TypeScript GitHub