This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

pstat

1.0.2 • Public • Published

pStat

npm npm

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 = require('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.isFile('./folder/file.txt', function(is_file){ /* do something */ });

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.isDir('./your/folder', function(is_dir){ /* do something */ });

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.

Package Sidebar

Install

npm i pstat

Weekly Downloads

313

Version

1.0.2

License

MIT

Last publish

Collaborators

  • jmjuanes