Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Parse JSON files with Bun
const file = Bun.file("data.json"); const data = await file.json(); console.log(data);
interface User { name: string; email: string; } const file = Bun.file("users.json"); const users: User[] = await file.json();
try { const file = Bun.file("config.json"); const config = await file.json(); } catch (error) { console.error("Invalid JSON:", error); }