pStat
Check if file or directory exists in Node.JS.
Install
Use NPM to install the package:
npm install pstat
Usage
Include the package using:
var pStat = ;
pStat.isFile(path, callback)
Asynchronously check if path exists and is a file. The callback is passed with true
if path exists and is a file or false
if not. Example:
pStat;
pStat.isFileSync(path)
Synchronous version of pStat.isFile
. Returns true
if path exists and is a file, false
if not.
pStat.isDir(path, callback)
Asynchronously check if path exists and is a directory. The callback is passed with true
if path exists and is a directory or false
if not. Example:
pStat;
pStat.isDirSync(path)
Synchronous version of pStat.isDir
. Returns true
if path exists and is a directory, false
if not.
License
MIT Jose M. Juanes.