# Import a JSON file (/docs/guides/runtime/import-json)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 218 · updated: 2026-07-28 -->
Related: [Delete directories](/docs/guides/runtime/delete-directory.md), [Delete files](/docs/guides/runtime/delete-file.md), [Import a HTML file as text](/docs/guides/runtime/import-html.md), [Import a JSON5 file](/docs/guides/runtime/import-json5.md), [Import a TOML file](/docs/guides/runtime/import-toml.md), [Import a YAML file](/docs/guides/runtime/import-yaml.md)

Bun natively supports `.json` imports.

```json package.json icon="file-json"
{
  "name": "bun",
  "version": "1.0.0",
  "author": {
    "name": "John Dough",
    "email": "john@dough.com"
  }
}
```

***

Import the file like any other source file.

```ts data.ts icon="/icons/typescript.svg"
import data from "./package.json";

data.name; // => "bun"
data.version; // => "1.0.0"
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 data.ts icon="/icons/typescript.svg"
import data from "./package.json" with { type: "json" };

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

***

See [TypeScript](/runtime/typescript) for more on using TypeScript with Bun.
