isdir
isdir
checks if a given file descriptor fd
is a directory or not.
(wrapper around node's native fs.stat.isDirectory()
method )
Usage
Install from NPM
npm install isdir --save
In your script
var isdir = ;var fd = __dirname; // or what ever you need to check ;
About
We needed a fully tested simple call to check if a descriptor is a directory for our faster project.
This module deliberately only exposes a single asynchronous method.
If you prefer to use it sychronously (go for a walk and consider switching programming languages) and if you still want to use it sync just assign the output to varaiable and omit the callback:
var isdir = ;var fd = __dirname; // or what ever descriptor you need to checkvar dir = ; // this works but is not encouraged (its blocking)ifdir // do what you want with your directory
Influenced by: https://github.com/jonschlinkert/is-directory (We wanted lighter error-handling and more tests)