Skip to content

Bun supporta nativamente l'import di file .toml.

toml
name = "bun"
version = "1.0.0"

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

Importa il file come qualsiasi altro file sorgente.

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

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

Vedi Docs > Runtime > TypeScript per maggiori informazioni sull'uso di TypeScript con Bun.

Bun a cura di www.bunjs.com.cn