# path-equal

> Determine two file paths are equal

Latest version **1.2.8** (published 2026-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-equal
pnpm add path-equal
yarn add path-equal
bun add path-equal
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.8 |
| Published | 2026-09-06 |
| First published | 2018-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8 |
| Author | Homa Wong (unional) |
| Maintainers | unional |

## Links

- npm: https://www.npmjs.com/package/path-equal
- Repository: https://github.com/cyberuni/path-equal
- Issues: https://github.com/cyberuni/path-equal/issues
- npm.io page: https://npm.io/package/path-equal

## Recent versions

- 1.2.8 (latest) — 2026-09-06
- 1.2.7 — 2026-09-01
- 1.2.6 — 2026-09-01
- 1.2.5 — 2022-11-27
- 1.2.4 — 2022-10-28
- 1.2.2 — 2022-06-13
- 1.2.1 — 2022-06-04
- 1.2.0 — 2022-05-30
- 1.1.3 — 2022-01-04
- 1.1.2 — 2021-03-28
- 1.1.1 — 2019-01-28
- 1.1.0 — 2018-05-02
- 1.0.0 — 2018-03-05

## README

# path-equal

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][npm-url]

[![GitHub NodeJS][github-nodejs]][github-action-url]
[![Codecov][codecov-image]][codecov-url]

[![Visual Studio Code][vscode-image]][vscode-url]

Compare two file paths regardless of platforms.

The file paths in Unix and Windows are different.

If you do not compare them correctly,
your code might work on one platform but not another.

This library provides this comparison to check if the two paths are the same,
regardless of the running platform.

## Install

```sh
# npm
npm install path-equal

# yarn
yarn add path-equal

# pnpm
pnpm install path-equal

#rush
rush add -p path-equal
```

## Usage

```ts
import { pathEqual } from 'path-equal'

pathEqual('dir/sub-dir/file.txt', 'dir\\sub-dir\\file.txt') // true
```

This library will not access the file system,
so comparing absolute path with relative path will fail.

## Contribute

```sh
# after fork and clone
pnpm install

# begin making changes
git checkout -b <branch>
pnpm test:watch

# after making change(s)
git commit -m "<commit message>"
git push

# create PR
```

[codecov-image]: https://codecov.io/gh/cyberuni/path-equal/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/cyberuni/path-equal
[downloads-image]: https://img.shields.io/npm/dm/path-equal.svg?style=flat
[github-nodejs]: https://github.com/cyberuni/path-equal/actions/workflows/release.yml/badge.svg
[github-action-url]: https://github.com/cyberuni/path-equal/actions/workflows/release.yml
[npm-image]: https://img.shields.io/npm/v/path-equal.svg?style=flat
[npm-url]: https://npmjs.org/package/path-equal
[vscode-image]: https://img.shields.io/badge/vscode-ready-green.svg
[vscode-url]: https://code.visualstudio.com/

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