GodotJS

0

GodotJS - Add TypeScript/JavaScript Support for Godot 4.x with v8

Infrastructure

typescript
scripting
javascript
godot

GodotJS

This project adds TypeScript/JavaScript Support for Godot 4.x by leveraging the high-performance capabilities of V8 to bring the delightful development experience of TypeScript into Godot. Meanwhile, it also supports switching to QuickJS, or even directly run scripts on the host browser JS VM if porting to web.

See Breaking Changes if upgrading from old versions.

windows macos linux

[!NOTE] The core functionality is implemented and essentially usable but still under testing.

typescript_intellisence

Features

  • Godot ScriptLanguage integration
  • Debug with Chrome/VSCode when using V8
  • REPL in Editor
  • Hot-reloading
  • Support for multiple javascript engines (v8, quickjs, quickjs-ng, the host Browser JS)
  • Worker threads (limited support) (experimental)
  • Asynchronously loaded modules (limited support)

Get Started

Before initiating, make sure to select the JavaScript runtime you prefer between v8, QuickJS and Web (See Supported Platforms):

  • v8 is proven to be one of the most powerful and high-performance JavaScript runtimes.
  • QuickJS is a remarkable and lightweight option.
  • Web is only suitable when building for Web. All scripts run on the host browser JS VM rather than an additional interpreter.

See Wiki for more details.

Examples

For more information on how to use GodotJS in a project, check out GodotJSExample for examples written in typescript.
And, don't forget to run npm install and npx tsc before opening the example project.

Example: Snake Example: Jummpy Bird

Supported Platforms

v8.implquickjs.implquickjs.impl (quickjs-ng)web.impl
Windows:x86_64
Windows:arm64
MacOS:x86_64✅ (not tested)✅ (not tested)✅ (not tested)
MacOS:arm64
Linux:x86_64✅ (not tested)✅ (not tested)
Linux:arm64
Android:x86_64✅ (not tested)✅ (not tested)✅ (not tested)
Android:arm64✅ (not tested)✅ (not tested)
iOS:x86_64✅ (not tested)✅ (not tested)✅ (not tested)
iOS:arm64✅ (not tested)✅ (not tested)✅ (not tested)
Web:wasm32✅ (not tested)✅ (not tested)✅ (debugging)
Debugger✅ Chrome/VSCode✅ browser devtools

Android: only tested on ndk_platform=android-24
Web: only tested on emsdk-3.1.64