feat(shell): add fs utils

This commit is contained in:
Il Harper 2024-03-04 02:15:36 +08:00
parent df6bd55302
commit a611208abb
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC

View File

@ -0,0 +1,10 @@
import { access } from 'node:fs/promises'
export async function exists(path: string): Promise<boolean> {
try {
await access(path)
} catch (_) {
return false
}
return true
}