file-or-dir

1.0.0 • Public • Published

File or dir

Check if a path is a file or a directory

Installation

npm install --save file-or-dir

Usage

const check = require('file-or-dir');

const path = 'my-file'

if (check(path) == 'file') {
  console.log(path + ' is a file');
} else if (check(path) == 'dir') {
  console.log(path + ' is a dir');
}

Working example in test.js

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i file-or-dir

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • tobihrbr
  • tobi~