> For AI agents: the complete documentation index is available at https://canary.gukhanmun.org/llms.txt, the full documentation bundle is available at https://canary.gukhanmun.org/llms-full.txt.

# Installation

Gukhanmun ships two JavaScript implementations that share the same API:

| Package           | Environments                               | Notes                               |
| ----------------- | ------------------------------------------ | ----------------------------------- |
| `@gukhanmun/wasm` | Browsers, Node.js 20+, Deno 2.0+, Bun 1.0+ | Recommended for broad compatibility |
| `@gukhanmun/napi` | Node.js 20+, Deno 2.0+, Bun 1.0+           | Faster on server; native code       |

For most projects, use `@gukhanmun/wasm`.  Switch to `@gukhanmun/napi` for
server workloads where throughput matters.

## WebAssembly

For most environments, the WebAssembly implementation is the best choice.
It runs in browsers, Node.js, Deno, and Bun, and does not require native code.
Install it with your package manager of choice:


```sh [npm]
npm add @gukhanmun/wasm
```

```sh [yarn]
yarn add @gukhanmun/wasm
```

```sh [pnpm]
pnpm add @gukhanmun/wasm
```

```sh [bun]
bun add @gukhanmun/wasm
```

```sh [deno]
deno add jsr:@gukhanmun/wasm
```

## Node-API

For Node.js, Deno, or Bun with the native addon:


```sh [npm]
npm add @gukhanmun/napi
```

```sh [yarn]
yarn add @gukhanmun/napi
```

```sh [pnpm]
pnpm add @gukhanmun/napi
```

```sh [bun]
bun add @gukhanmun/napi
```

```sh [deno]
deno add npm:@gukhanmun/napi
```

## Standard Korean Dictionary

The JavaScript packages do not bundle the _Standard Korean Dictionary_.  Install
it separately:


```sh [npm]
npm add @gukhanmun/stdict-fst
```

```sh [yarn]
yarn add @gukhanmun/stdict-fst
```

```sh [pnpm]
pnpm add @gukhanmun/stdict-fst
```

```sh [bun]
bun add @gukhanmun/stdict-fst
```

```sh [deno]
deno add jsr:@gukhanmun/stdict-fst
```


```sh [npm]
npm add @gukhanmun/stdict-cdb
```

```sh [yarn]
yarn add @gukhanmun/stdict-cdb
```

```sh [pnpm]
pnpm add @gukhanmun/stdict-cdb
```

```sh [bun]
bun add @gukhanmun/stdict-cdb
```

```sh [deno]
deno add jsr:@gukhanmun/stdict-cdb
```

Both packages contain the same dictionary; the formats differ in their
lookup characteristics.  For most use cases, prefer the FST package.

## Open Korean Dictionary

The _Open Korean Dictionary_ (우리말샘) packages are split by dictionary format
and expose separate general (一般語), North Korean (北韓語), dialect (方言),
and archaic (옛말) category loaders:


```sh [npm]
npm add @gukhanmun/opendict-fst
```

```sh [yarn]
yarn add @gukhanmun/opendict-fst
```

```sh [pnpm]
pnpm add @gukhanmun/opendict-fst
```

```sh [bun]
bun add @gukhanmun/opendict-fst
```

```sh [deno]
deno add jsr:@gukhanmun/opendict-fst
```


```sh [npm]
npm add @gukhanmun/opendict-cdb
```

```sh [yarn]
yarn add @gukhanmun/opendict-cdb
```

```sh [pnpm]
pnpm add @gukhanmun/opendict-cdb
```

```sh [bun]
bun add @gukhanmun/opendict-cdb
```

```sh [deno]
deno add jsr:@gukhanmun/opendict-cdb
```

## Loanword spelling examples

Install the National Institute of Korean Language's _Loanword spelling
examples_ in either FST or CDB format:


```sh [npm]
npm add @gukhanmun/loanwords-fst
```

```sh [yarn]
yarn add @gukhanmun/loanwords-fst
```

```sh [pnpm]
pnpm add @gukhanmun/loanwords-fst
```

```sh [bun]
bun add @gukhanmun/loanwords-fst
```

```sh [deno]
deno add jsr:@gukhanmun/loanwords-fst
```


```sh [npm]
npm add @gukhanmun/loanwords-cdb
```

```sh [yarn]
yarn add @gukhanmun/loanwords-cdb
```

```sh [pnpm]
pnpm add @gukhanmun/loanwords-cdb
```

```sh [bun]
bun add @gukhanmun/loanwords-cdb
```

```sh [deno]
deno add jsr:@gukhanmun/loanwords-cdb
```

Neither preset loads these packages automatically. See
[_Dictionaries_](https://canary.gukhanmun.org/guide/javascript/dictionary.md#loanword-spelling-examples-packages) for loader
examples and dictionary priority.

## NAPI platform binaries

`@gukhanmun/napi` includes prebuilt binaries for:

- macOS: ARM64, x86\_64
- Windows: ARM64, x86\_64
- Linux (glibc): ARM64, x86\_64

Alpine Linux (musl) requires building from source.
