> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wyrly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# インストール

> Deno、Node.js、Bun、対応 Web フレームワーク向けに Wyrly DI をインストールします。

まず `@wyrly/core` をインストールします。フレームワークアダプターは、アプリで必要になったときだけ追加してください。

## Deno 2.x

Deno project では JSR を使います。

```sh theme={null}
deno add jsr:@wyrly/core
```

その後、`@wyrly/core` から import します。

```ts theme={null}
import { createContainer, Injectable, token } from "@wyrly/core";
```

## Node.js 20+

Node.js とバンドラーベースのアプリケーションでは npm を使います。

```sh theme={null}
npm install @wyrly/core
```

```ts theme={null}
import { createContainer, Injectable, token } from "@wyrly/core";
```

## Bun

Bun では npm パッケージを使います。

```sh theme={null}
bun add @wyrly/core
```

```ts theme={null}
import { createContainer, Injectable, token } from "@wyrly/core";
```

## Framework adapters

ランタイムに合うアダプターをインストールします。

| Runtime                       | Package          |
| ----------------------------- | ---------------- |
| Next.js App Router            | `@wyrly/next`    |
| Express                       | `@wyrly/express` |
| Hono                          | `@wyrly/hono`    |
| Fresh 2.x                     | `@wyrly/fresh`   |
| GraphQL request context（低レベル） | `@wyrly/graphql` |
| Fastify 5                     | `@wyrly/fastify` |
| GraphQL Yoga 5                | `@wyrly/yoga`    |
| Apollo Server 4+              | `@wyrly/apollo`  |

GraphQL コンテキストを自分で組み立てる場合は `@wyrly/graphql` を使います。Yoga や Apollo Server
との統合には `@wyrly/yoga` または `@wyrly/apollo` をインストールしてください — [Framework adapters](/ja/guides/framework-adapters) を参照。

たとえば Next.js adapter は次のようにインストールします。

```sh theme={null}
npm install @wyrly/next @wyrly/core
```

## 要件

* TypeScript 5+
* 標準デコレーター
* `experimentalDecorators: false`
* ESM 対応のランタイムまたはバンドラー
* Deno 2.x、Node.js 20+、Bun、または対応 Web フレームワーク

Wyrly は `reflect-metadata` や `emitDecoratorMetadata` を必要としません。

## リポジトリのローカル開発

Wyrly のソースに貢献する場合:

```sh theme={null}
git clone https://github.com/valid-lab/wyrly.git
cd wyrly
deno task setup:hooks
deno task check
deno task test
```
