Skip to content

Bun unterstützt das Importieren von .toml-Dateien nativ.

toml
name = "bun"
version = "1.0.0"

[author]
name = "John Dough"
email = "john@dough.com"

Importieren Sie die Datei wie jede andere Quelldatei.

ts
import data from "./data.toml";

data.name; // => "bun"
data.version; // => "1.0.0"
data.author.name; // => "John Dough"

Siehe Docs > Runtime > TypeScript für weitere Informationen zur Verwendung von TypeScript mit Bun.

Bun von www.bunjs.com.cn bearbeitet