Bun.file() 関数はパスを受け付け、BunFile インスタンスを返します。.exists() メソッドを使用して、指定されたパスにファイルが存在するかを確認します。
ts
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;BunFile の操作の詳細については、API > ファイル I/O ドキュメントを参照してください。