Big update!Introducing GitHub Bot Commands. Learn more
Socket
BlogLoveLog in
Book a demo

path-type

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

path-type

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

    5.0.0latest

Version published
Maintainers
1
Weekly downloads
49,647,192
increased by2.68%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12 (#8) 24e52d3
  • This package is now pure ESM
    • This means you need to use import {isFile} from 'path-type' instead of const {isFile} = require('path-type').
    • I would recommend moving to ESM. ESM can still import CommonJS packages, but CommonJS cannot import ESM packages synchronously.
    • If you cannot move to ESM yet, don't upgrade to this version.

https://github.com/sindresorhus/path-type/compare/v4.0.0...v5.0.0

Readme

Source

path-type

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

Install

$ npm install path-type

Usage

import {isFile} from 'path-type'; 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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is path-type?

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

Is path-type popular?

The npm package path-type receives a total of 47,633,438 weekly downloads. As such, path-type popularity was classified as popular.

Is path-type well maintained?

We found that path-type demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 27 Jan 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc