mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 10:27:15 +00:00
12 lines
196 B
TypeScript
12 lines
196 B
TypeScript
|
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
|
||
|
}
|
||
|
}
|