# normalize-pathname

> normalizes any pathname to one leading slash and no trailing slash

Latest version **1.0.1** (published 2013-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install normalize-pathname
pnpm add normalize-pathname
yarn add normalize-pathname
bun add normalize-pathname
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2013-09-27 |
| First published | 2013-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jon Packer |
| Maintainers | jonpacker |
| Keywords | normalize, pathname |

## Links

- npm: https://www.npmjs.com/package/normalize-pathname
- Repository: http://github.com/jonpacker/normalize-pathname
- npm.io page: https://npm.io/package/normalize-pathname

## 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.1 (latest) — 2013-09-27
- 1.0.0 — 2013-09-27

## README

# normalize-pathname

Normalizes any pathname to the same format: one leading slash, no trailing slash.

## install

```
npm install normalize-pathname
```

## usage

```javascript
var normalizePathname = require('normalize-pathname');
console.log(normalizePathname('wibblebong/wollomombi/'));
// -> '/wibblebong/wollomombi'
```

## examples

```
/one/two/ -> /one/two
one/two   -> /one/two
one/two/  -> /one/two
one       -> /one
/one/     -> /one
one/      -> /one
/         -> (empty string)
```

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