La función Bun.file() acepta una ruta y retorna una instancia BunFile. La clase BunFile extiende Blob, así que usa la propiedad .type para leer el tipo MIME.
ts
const file = Bun.file("./package.json");
file.type; // application/json
const file = Bun.file("./index.html");
file.type; // text/html
const file = Bun.file("./image.png");
file.type; // image/pngConsulta API > E/S de archivos para más información sobre cómo trabajar con BunFile.