JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 70302080
  • Score
    100M100P100Q232070F
  • License MIT

Check if a path is a file, directory, or symlink

Package Exports

  • path-type

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (path-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

path-type Build Status

Check if a path is a file, directory, or symlink

Install

$ npm install path-type

Usage

const {isFile} = require('path-type');

(async () => {
    console.log(await isFile('package.json'));
    //=> true
})();

API

isFile(path)

Check whether the passed path is a file.

Returns a Promise<boolean>.

path

Type: string

The path to check.

isDirectory(path)

Check whether the passed path is a directory.

Returns a Promise<boolean>.

isSymlink(path)

Check whether the passed path is a symlink.

Returns a Promise<boolean>.

isFileSync(path)

Synchronously check whether the passed path is a file.

Returns a boolean.

isDirectorySync(path)

Synchronously check whether the passed path is a directory.

Returns a boolean.

isSymlinkSync(path)

Synchronously check whether the passed path is a symlink.

Returns a boolean.

License

MIT © Sindre Sorhus