https://github.com/godotjs/javascript
Javascript binding for godotengine
https://github.com/godotjs/javascript
godot godot-js javascript typescript
Last synced: 9 months ago
JSON representation
Javascript binding for godotengine
- Host: GitHub
- URL: https://github.com/godotjs/javascript
- Owner: godotjs
- License: mit
- Created: 2019-02-04T15:27:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-27T22:14:42.000Z (over 1 year ago)
- Last Synced: 2025-05-11T20:45:38.352Z (9 months ago)
- Topics: godot, godot-js, javascript, typescript
- Language: C++
- Homepage: https://godotjs.github.io/
- Size: 2.64 MB
- Stars: 1,059
- Watchers: 27
- Forks: 85
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

# **GodotJS**
***-- JavaScript and TypeScript language binding for Godot game engine --***
This module implements JavaScript/TypeScript language support for the Godot game engine using [QuickJS](https://bellard.org/quickjs/) as the JavaScript engine.
## Getting started
Read the [getting-started](https://godotjs.github.io/documentation/getting-started/).
## Features
- Almost complete ES2020 support
- All Godot API available
- Operator overriding for built-in types (Vector3, Color, etc)
- TypeScript support
- [Using third-party libraries from npm](https://github.com/GodotExplorer/ECMAScriptDemos/tree/master/npm_module)
- Multi-thread support with Worker API
- Full code completion support for all Godot APIs including signals and enumerations
- Debug in Visual Studio Code with the [plugin](https://marketplace.visualstudio.com/items?itemName=geequlim.godot-javascript-debug) - currently not available for 4.x
## Getting the engine
No installation or setup necessary. The binaries for download are the complete, usable Godot editor and engine with JavaScript/TypeScript language support.
### Binary downloads
Download the binaries from the [release page](https://github.com/GodotExplorer/ECMAScript/releases).
### Compiling from source
- Clone the source code of [godot](https://github.com/godotengine/godot):
- `git clone git@github.com:godotengine/godot.git` or
- `git clone https://github.com/godotengine/godot.git`
- This branch uses version `4.1` so checkout the version with: `git checkout 4.1`
- Clone this module and put it into `godot/modules/javascript`:
- `git clone git@github.com:godotjs/javascript.git godot/modules/javascript` or
- `git clone https://github.com/godotjs/javascript.git godot/modules/javascript`
- [Recompile the godot engine](https://docs.godotengine.org/en/4.1/development/compiling/index.html)
- Use `scons` with those additional options `warnings=extra werror=yes module_text_server_fb_enabled=yes` to show all potential errors:
- Windows: `scons platform=windows warnings=extra werror=yes module_text_server_fb_enabled=yes`
- MacOS: `scons platform=macos arch=arm64 warnings=extra werror=yes module_text_server_fb_enabled=yes`
- **Hint**: To enable unit tests you need to add ``tests=true`` to `scons` arguments
## Documentation, Tutorials & Demos
Read this [documentation](https://godotjs.github.io/documentation/getting-started/) or look at the tutorials or demos:
- [ECMAScriptDemos](https://github.com/godotjs/javascriptDemos) - Demos
- [godot-ECMAScript-cookbook](https://github.com/why-try313/godot-ECMAScript-cookbook/wiki) - Tutorial
- [godot-typescript-starter](https://github.com/citizenll/godot-typescript-starter) - Template
- [godot-js-template](https://github.com/fukaraadam-workspace/godot-js-template) - Template
## Contributing
If you like to contribute to this project check the [CONTRIBUTING.md](https://github.com/godotjs/javascript/blob/master/CONTRIBUTING.md) file.