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 hello gd:@mofukuma/hello@0.1.3

hello is your local alias. The scoped name identifies the published package.

helloは手元で使う呼び名。@mofukuma/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. Use @import "./settings" for local scripts and shared constants, too.

gd main.gdhello, worldを表示します。手元のscriptや共通定数にも@import "./settings"を使えます。

Commit gd.json (requested dependencies) and gd.lock (resolved versions and hashes). Other machines restore them with gd install --frozen. Packages extend scripts; native extensions add compiled APIs.

gd.json(必要な依存)とgd.lock(解決した版とハッシュ)をcommitし、別の環境ではgd install --frozenで復元します。scriptパッケージは処理の再利用、native拡張はコンパイル済みAPIの追加に使います。

Runnable samples →