mirror of https://github.com/seald/nedb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
367 B
7 lines
367 B
import fs from 'node:fs/promises'
|
|
import { constants as fsConstants } from 'node:fs'
|
|
|
|
export const exists = path => fs.access(path, fsConstants.FS_OK).then(() => true, () => false)
|
|
|
|
// eslint-disable-next-line n/no-callback-literal
|
|
export const existsCallback = (path, callback) => fs.access(path, fsConstants.FS_OK).then(() => callback(true), () => callback(false))
|
|
|