.yaml and .yml imports.
config.yaml
Import the file like any other source file.
You can also destructure top-level properties with named imports:
Bun also supports Import Attributes syntax:
For parsing YAML strings at runtime, use
Bun.YAML.parse():
TypeScript Support
To add TypeScript support for your YAML imports, create a declaration file with.d.ts appended to the YAML filename (for example, config.yaml → config.yaml.d.ts):
See YAML.