# pathnorm

> fix path.normalize to cross platform

Latest version **0.0.2** (published 2014-03-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install pathnorm
pnpm add pathnorm
yarn add pathnorm
bun add pathnorm
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-03-09 |
| First published | 2014-03-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tsuyusato Kitsune |
| Maintainers | makenowjust |
| Keywords | path |

## Links

- npm: https://www.npmjs.com/package/pathnorm
- Repository: https://github.com/MakeNowJust/node-pathnorm
- Issues: https://github.com/MakeNowJust/node-pathnorm/issues
- npm.io page: https://npm.io/package/pathnorm

## 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

- 0.0.2 (latest) — 2014-03-09
- 0.0.1 — 2014-03-09

## README

#pathnorm

![Build Status](https://api.travis-ci.org/MakeNowJust/node-pathnorm.png)

fix path.normalize to cross platform

##API

```js
var
path = require('path'),
pathnorm = require('pathnorm');
```

###`pathnorm.normalize(p, [useSep='/'])`

`p` normalize as path with separator `useSep`

e.g.

```
pathnorm.normalize('a/b/c');   //=> 'a/b/c'
pathnorm.normalize('a\\b\\c'); //=> 'a/b/c'

pathnorm.normalize('a/b/c', '/');    //=> 'a\\b\\c'
pathnorm.normalize('a\\b\\c', '\\'); //=> 'a\\b\\c'

//it returns `true` on all platform
pathnorm.normalize('a/b/c', pathnorm.sep) === path.normalize('a/b/c');
```

###`pathnorm.sep`

a file separator of your platform. (e.g. if you use windows, `pathnorm.sep` is `'\\'`, or if you use unix like os, `pathnorm.sep` is `'/'`)

###`pathnorm.seps`

the separator of each platforms.

such a object:

```js
{
  win32: '\\',
  darwin:  '/',
  freebsd: '/',
  linux:   '/',
  sunos:   '/',
}
```

##License

this library licensed Apache-2.0

##Author

Tsuyusato Kitsune <make.just.on@gmail.com>

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