Nuxt/packages/nuxi/src/utils/fs.ts

12 lines
196 B
TypeScript
Raw Normal View History

import { promises as fsp } from 'fs'
// Check if a file exists
export async function exists (path: string) {
try {
await fsp.access(path)
return true
} catch {
return false
}
}