Skip to main content

bud.fs.exists

Check whether something exists on a given path.

Usage

bud.fs.exists returns different values depending on what is found at the given path.

  • false if the path doesn't exist
  • dir if the path is a directory
  • file if the path is a file
  • other if the none of the above
const result = await bud.fs.exists(`path/to/dir`)
// result => `dir`
const result = await bud.fs.exists(`not/a/path`)
// result => `false`