1. is-directory
Returns true if a filepath exists on the file system and it's directory.
is-directory
Package: is-directory
Created by: jonschlinkert
Last modified: Sun, 19 Jun 2022 02:39:40 GMT
Version: 0.3.1
License: MIT
Downloads: 25,062,042
Repository: https://github.com/jonschlinkert/is-directory

Install

npm install is-directory
yarn add is-directory

is-directory NPM version NPM downloads Build Status

Returns true if a filepath exists on the file system and it's directory.

Install

Install with npm:

 $ npm install is-directory --save

Usage

 var isDirectory = require('is-directory');

isDirectory('node_modules', function(err, dir) {
  if (err) throw err;
  console.log(dir);
  //=> true
});

isDirectory.sync('README.md');
//=> false

You might also be interested in these projects:

  • is-absolute: Polyfill for node.js path.isAbolute. Returns true if a file path is absolute. | homepage
  • is-glob: Returns true if the given string looks like a glob pattern or an extglob pattern.… more | homepage
  • is-relative: Returns true if the path appears to be relative. | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

 $ npm install verb && npm run docs

Or, if verb is installed globally:

 $ verb

Running tests

Install dev dependencies:

 $ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert.
Released under the MIT license.


This file was generated by verb, v0.9.0, on May 21, 2016.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code