diff options
author | 2023-07-31 12:20:23 -0700 | |
---|---|---|
committer | 2023-07-31 12:20:23 -0700 | |
commit | 404b90badc5856a74c06d04062c850003e28fed5 (patch) | |
tree | 7954623cf4a792db612d0bb229a227c2ff1e9fd8 /docs/guides/runtime/import-toml.md | |
parent | 67599f97adc77141331a5f4fc39e4d058dc70b2a (diff) | |
download | bun-404b90badc5856a74c06d04062c850003e28fed5.tar.gz bun-404b90badc5856a74c06d04062c850003e28fed5.tar.zst bun-404b90badc5856a74c06d04062c850003e28fed5.zip |
Add ecosystem guides (#3847)
* Add ecosystem guides
* Update titles
* Rename stric
* Add unlink and fetch guides
* Add formdata guide
* Tweak title
* Moar
Diffstat (limited to 'docs/guides/runtime/import-toml.md')
-rw-r--r-- | docs/guides/runtime/import-toml.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/guides/runtime/import-toml.md b/docs/guides/runtime/import-toml.md new file mode 100644 index 000000000..2a2e47aa4 --- /dev/null +++ b/docs/guides/runtime/import-toml.md @@ -0,0 +1,30 @@ +--- +name: Import a TOML file +--- + +Bun natively supports importing `.toml` files. + +```toml#data.toml +name = "bun" +version = "1.0.0" + +[author] +name = "John Dough" +email = "john@dough.com" +``` + +--- + +Import the file like any other source file. + +```ts +import data from "./data.toml"; + +data.name; // => "bun" +data.version; // => "1.0.0" +data.author.name; // => "John Dough" +``` + +--- + +See [Docs > Runtime > TypeScript](/docs/runtime/typescript) for more information on using TypeScript with Bun. |