# path-type-lab

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

Latest version **4.0.0** (published 2023-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-type-lab
pnpm add path-type-lab
yarn add path-type-lab
bun add path-type-lab
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2023-03-01 |
| First published | 2023-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 81 |
| Author | Sindre Sorhus |
| Maintainers | labman4 |
| Keywords | path, fs, type, is, check, directory, dir, file, filepath, symlink, symbolic, link, stat, stats, filesystem |

## Links

- npm: https://www.npmjs.com/package/path-type-lab
- Repository: https://github.com/sindresorhus/path-type
- Homepage: https://github.com/sindresorhus/path-type#readme
- Issues: https://github.com/sindresorhus/path-type/issues
- npm.io page: https://npm.io/package/path-type-lab

## Dependencies (1)

- [memfs-lab](https://npm.io/package/memfs-lab.md) ^3.4.13

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2023-03-01
- 5.0.1 — 2023-02-28

## README

# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type)

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


## Install

```
$ npm install path-type
```


## Usage

```js
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](https://sindresorhus.com)

---
_Source: https://npm.io/package/path-type-lab · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
