existent
Check if one or more paths exist, promise-less.
examples
const existent = // Takes an optional base path // Synchronous variant (returns boolean)existent // Assertionexistent
api
existent(path(s), [base], callback)
Asynchronous variant. If base
is provided (a string or array), it will be prepended to each path
. The callback receives three arguments:
- error or null
- array of resolved missing paths
- array of resolved existing paths
existent.sync(path(s), [base])
Synchronous variant, returns a boolean.
existent.assert(path(s), [base])
Throws if one or more paths do not exist.
install
With npm do:
npm install existent --save
license
MIT © Vincent Weevers