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

react-godot-4

v1.0.2

Published

Load a webassembly build of the Godot engine and Bootstrap packed games from within the react component tree

Readme

react-godot-4

Load a webassembly build of Godot and Bootstrap packed games from within the react component tree.

Install

npm install --save react-godot-4

Usage

import * as React from "react";

import ReactGodot from "react-godot-4";

class Example extends React.Component {
  render() {
    return (
      <ReactGodot
        script="/path/to/myGame.js"
        pck="/path/to/myGame.pck"
        wasm="/path/to/myGame.wasm"
      />
    );
  }
}

Godot 4

Background

This package was originally developed by d3dc. Unfortunately, their builds no longer seem to work with newer versions of Godot. This seems to stem from a change in how configuration data (specifically the WASM file) is passed into the engine.

Thankfully, Eric Wang forked the original repo and added some fixes for this issue. Unfortunately though, he did not publish his changes to a site like npm...leaving the project (and the original d3dc repo) more-or-less abandoned.

Having come across this issue, I decided to add some new functionality to Eric's code and publish it as a 'new' package. Hopefully the name indicates why this exists in the first place.

Custom Configuration

When you generate a web build, godot packages some configuration information in the index.html file like so:

<script>
  const GODOT_CONFIG = {
    args: [],
    canvasResizePolicy: 2,
    ensureCrossOriginIsolationHeaders: true,
    executable: "index",
    experimentalVK: false,
    fileSizes: { "index.pck": 3531856, "index.wasm": 43699190 },
    focusCanvas: true,
    gdextensionLibs: [],
  };
  const GODOT_THREADS_ENABLED = false;
  const engine = new Engine(GODOT_CONFIG);

This GODOT_CONFIG data isn't needed for most games to run...but if you would like your configuration data passed to the engine, you can just copy/paste it from your index file into a simple js object and pass it as the additional config prop like so:

"use client";
import React from "react";
import ReactGodot, { GodotEngineConfig } from "react-godot";

export default function TestGame() {
  const config: GodotEngineConfig = {
    args: [],
    canvasResizePolicy: 2,
    ensureCrossOriginIsolationHeaders: true,
    executable: "index",
    experimentalVK: false,
    focusCanvas: true,
    gdextensionLibs: [],
  };
  return (
    <ReactGodot
      pck="/games/3d/Squash the Creeps (3D).pck"
      script="/games/3d/Squash the Creeps (3D).js"
      wasm="/games/3d/Squash the Creeps (3D).wasm"
      width={1200}
      height={780}
      config={config}
    ></ReactGodot>
  );
}

The GodotEngineConfig type should 'just work'...but if you spot any issues, send me a pull request and I'll have it fixed up.

License

Originally MIT © d3dc

Later contributions by Eric Wang and Meir Arani