Bun.file() 함수는 경로를 허용하며 BunFile 인스턴스를 반환합니다. .exists() 메서드를 사용하여 주어진 경로에 파일이 존재하는지 확인합니다.
ts
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;BunFile 작업에 대한 자세한 내용은 API > 파일 I/O 를 참조하세요.