--- name: Read a JSON file --- The `Bun.file()` function accepts a path and returns a `BunFile` instance. The `BunFile` class extends `Blob` and allows you to lazily read the file in a variety of formats. Use `.json()` to read and parse the contents of a `.json` file as a plain object. The MIME type of the `BunFile` will be set accordingly. ```ts const path = "/path/to/package.json"; const file = Bun.file(path); const contents = await file.json(); // { name: "my-package" } file.type; // => "application/json;charset=utf-8"; ``` ref='/'>index : bun
Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/baz.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-04-18[timer] Remove timer.zig and use system_timer.zig (#149)Gravatar wangao 6-33/+7
2022-04-18[build] Fix Dockerfile COPY slash (#147)Gravatar wangao 2-5/+5
2022-04-18not sure yetGravatar Jarred Sumner 4-92/+107
2022-04-18fix wasm build take 2 (one more thing is broken)Gravatar Jarred Sumner 15-195/+641
2022-04-18Fix wasm buildGravatar Jarred Sumner 6-13/+58
2022-04-18[node] Add more fs constants (#144)Gravatar wangao 4-137/+201
2022-04-16Move some code around + delete dead codeGravatar Jarred Sumner 4-2113/+1889
2022-04-16[JS Parser] Support explicit removingGravatar Jarred Sumner 10-88/+480
2022-04-16Workaround C ABI bugGravatar Jarred Sumner 1-9/+12
2022-04-16[JS Parser] API for removing & replacing exportsGravatar Jarred Sumner 2-85/+495
2022-04-15Update README.mdGravatar Jarred Sumner 1-29/+0