Function: stdictCdbBytes()

stdictCdbBytes(url?): Promise<Uint8Array<ArrayBuffer>>

Loads the bundled Standard Korean Language Dictionary as raw bytes.

The access strategy is chosen from the URL scheme, not from the host runtime. A file: URL is read from disk with node:fs/promises (Node.js, Deno, and Bun all provide it, and it is the only option since Node.js's fetch rejects file: URLs); any other scheme is retrieved with fetch.

Branching on the scheme is what makes a JSR install work on Deno: there import.meta.url (and therefore stdictCdbUrl) is an https: URL, yet Deno also exposes process.versions.node, so a runtime sniff would wrongly take the node:fs path and readFile would reject the https: URL with "The URL must be of scheme file".

Parameters

url?

URL = stdictCdbUrl

Location of the CDB binary to read. Defaults to the bundled stdictCdbUrl; pass another URL to load a relocated copy.

Returns

Promise<Uint8Array<ArrayBuffer>>

The CDB binary as a Uint8Array.