[Runtime
](../../../index.md)[Package Manager
](../../../pm/cli/install/index.md)[Bundler
](../../../bundler/index.md)[Test Runner
](../../../test/index.md)[Guides
](../../index.md)[Reference
](https://bun.com/reference)[Blog
](https://bun.com/blog)[Feedback
](../../../feedback/index.md)
Bun natively supports .json imports.
package.json
{
"name": "bun",
"version": "1.0.0",
"author": {
"name": "John Dough",
"email": "john@dough.com"
}
}
Import the file like any other source file.
data.ts
import data from "./package.json";
data.name; // => "bun"
data.version; // => "1.0.0"
data.author.name; // => "John Dough"
Bun also supports Import Attributes and JSON modules syntax.
data.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 for more information on using TypeScript with Bun.
Was this page helpful?
[
Codesign a single-file JavaScript executable on macOS
Previous
](../codesign-macos-executable/index.md)[
Import a TOML file
Next
](../import-toml/index.md)