From ce1286efef6832225641d479876129107f5bf25f Mon Sep 17 00:00:00 2001 From: guest271314 Date: Sun, 4 Aug 2024 08:59:00 -0700 Subject: [PATCH] Try to fix formatting in rendered guides document (#13077) --- docs/guides/runtime/import-json.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/guides/runtime/import-json.md b/docs/guides/runtime/import-json.md index d7c2424ab4..8a6a4cbb10 100644 --- a/docs/guides/runtime/import-json.md +++ b/docs/guides/runtime/import-json.md @@ -39,4 +39,16 @@ data.author.name; // => "John Dough" --- +Bun also supports [Import Attributes](https://github.com/tc39/proposal-import-attributes/) and [JSON modules](https://github.com/tc39/proposal-json-modules) syntax. + +```ts +import data from "./package.json" with { type: "json" }; + +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.