本页还没有译文
本页 3 段还没译成日本語,下面显示的是英文原文。Check if a file exists
还没翻译译自英文(bun.com)本页 3 段都还没译
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.
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;See File I/O for more on working with BunFile.
AI 翻译查看英文原文