mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-16 12:51:39 +00:00
feat(shell): add fs utils
This commit is contained in:
parent
df6bd55302
commit
a611208abb
10
packages/shell/src/utils/fs.ts
Normal file
10
packages/shell/src/utils/fs.ts
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user