The package registry

A little more
for your next idea.

次のアイデアに、
新しい道具を。

Find a package. Add it to your script. Build something of your own.

パッケージを見つけて、スクリプトへ。作りたいものに、まっすぐ進もう。

From package to script.

パッケージを、スクリプトへ。

1. Add a dependency

1. 依存を追加

mkdir hello-app
cd hello-app
gd init
gd add @gd/hello

This records the package in gd.json and fetches it. You import it by its short name, hello.

gd.jsonに記録して取得します。スクリプトからは短い名前のhelloで読み込みます。

2. Import it in main.gd

2. main.gdで読み込む

@import hello

func main():
    print(hello.message("world"))
    return 0

Run gd main.gd to print hello, world. Your own files are imported the same way: @import "./settings".

gd main.gdでhello, worldを表示します。自分のファイルも@import "./settings"のように読み込めます。

Commit gd.json and gd.lock. Another machine restores the same versions with gd install --frozen. Remove a package with gd uninstall hello. Commands below starting with ext: add a native extension, which brings a compiled API.

gd.jsonとgd.lockをコミットします。別の環境ではgd install --frozenで同じ版を復元できます。外すときはgd uninstall helloです。下の一覧でext:から始まるコマンドは、コンパイル済みのAPIを足すネイティブ拡張です。

Runnable sample →