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

xg-game-engine-framework

v0.0.1

Published

a functional javascript game engine framework

Downloads

15

Readme

xg game engine framework

a functional javascript game engine framework

The current goal is just to experiment. I've got no experience in game development but a lot of web and functional programming experience. While this project is just a concept right now, I have an architecture in mind that will guide my initial tests. It is largely based on redux.

  • The goal is to have the whole framework transparent and pluggable.
  • You mantain a single state object for your whole app.
  • The state is passed around between your various modules.
  • All your modules must be named reducers.
  • Your modules are composed together.
  • Your modules may be altered by pluggable enhancers.

Quick start

This is how an engine can be started up.

// ./src/engine.js

xg({
  modules: [ ...modules ],
  [, enhancers: [ ...enhancers ]]
});

Due to our highly componentized structure, it's easy to imagine higher order functions that wrap certain defaults like setup handling, physics, object pooling and rendering.

Modules

// ./src/modules/render

const renderModule = {
  id: 'xg.render',
  reducer: (state, statePool) => {

    return {
      ...state,
      rendered: true
    };

  }
}

export default renderModule;

A module is defined by it's id and reducer.

The id can be used when working with enhancers that target specific modules. Since nothing prevents ids from clashing it's advised that you follow the creator.moduleName pattern.

The reducer receives the current app state. Deals with it then returns the altered state so the loop continues.

Side effects

Normally, handling side effects like fetching resources on a functional loop should be avoided. But since this is so common we must define a standard so we can deal with this 'anti-pattern' in the most predictable way.

One way to do this is to store a mutable object inside our immutable state. WHAT? Yes. We will have to deal with this object differently and none of it's changes will be apparent when comparing root states. But at least this way we can continue to deal with pure modules even when dealing with async side effects.

Something like this:


   :
   | module -> check state -> async action
   | module -> no changes          |
   | module -> no changes          |
   | module -> no changes     change state
   | module -> deal with changes
   :