# canonical-path

> paths that always use forward slashes

Latest version **1.0.0** (published 2018-10-24) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.0.0 |
| Published | 2018-10-24 |
| First published | 2013-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Pete Bacon Darwin |
| Maintainers | petebd |
| Keywords | path, forward, slashes, OS, windows |

## Links

- npm: https://www.npmjs.com/package/canonical-path
- Repository: https://github.com/petebacondarwin/node-canonical-path
- Homepage: https://github.com/petebacondarwin/node-canonical-path#readme
- Issues: https://github.com/petebacondarwin/node-canonical-path/issues
- npm.io page: https://npm.io/package/canonical-path

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-10-24
- 0.0.2 — 2013-12-19
- 0.0.1 — 2013-12-19

## README

# Canonical Path Utility

When writing node.js code that must support Windows and *nix OSes, it is sometimes frustrating
that path segments are separated differently depending upon the environment.

Ironically, we can pass in paths with either separator and the library will normalize it to the
current OS's format. But it then returns paths using the current OS's separator.

This utility simple wraps the built-in `path` library such that it only ever returns path segments
separated by forward slashes (/).

## Installation

```
npm install --save canonical-path
```

## Usage

```
var path = require('canonical-path');

var p = path.normalize('a/b/../c');
// p === 'a/c';
```

## Testing

```
npm test
```

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