Tauri exists
exists(: , :FsOptions):Promisepathstringoptions?<boolean>
检查路径是否存在。
例
import { exists, BaseDirectory } from '@tauri-apps/api/fs';
// Check if the `$APPDATA/avatar.png` file exists
await exists('avatar.png', { dir: BaseDirectory.AppData });Since: 1.1.0
参数
| 名字 | 类型 |
|---|---|
path | string |
options | FsOptions |
Returns: Promise<boolean>