# Check if a file exists (/guides/read-file/exists)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 95 · updated: 2026-07-28 -->
Related: [Read a file to an ArrayBuffer](/guides/read-file/arraybuffer.md), [Read a file to a Buffer](/guides/read-file/buffer.md), [Read a JSON file](/guides/read-file/json.md), [Get the MIME type of a file](/guides/read-file/mime.md), [Read a file as a ReadableStream](/guides/read-file/stream.md), [Read a file as a string](/guides/read-file/string.md)

The `Bun.file()` function accepts a path and returns a `BunFile` instance. Use the `.exists()` method to check if a file exists at the given path.

```ts icon="/icons/typescript.svg" title="index.ts"
const path = "/path/to/package.json";
const file = Bun.file(path);

await file.exists(); // boolean;
```

***

See [File I/O](/runtime/file-io) for more on working with `BunFile`.
