# node-path-extras

> extra utilities for `path` module of nodejs

Latest version **0.4.1** (published 2015-12-24) · 0 weekly downloads

## Install

```sh
npm install node-path-extras
pnpm add node-path-extras
yarn add node-path-extras
bun add node-path-extras
```

## 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.4.1 |
| Published | 2015-12-24 |
| First published | 2015-06-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | luckydrq |
| Maintainers | luckydrq |
| Keywords | path, extras |

## Links

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

## 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.4.1 (latest) — 2015-12-24
- 0.4.0 — 2015-07-11
- 0.3.1 — 2015-07-11
- 0.3.0 — 2015-06-27
- 0.2.1 — 2015-06-27
- 0.1.0 — 2015-06-27

## README

# node-path-extras
extra utilities for `path` module of nodejs

# API

## path.contains(mainPath, subPath)

```javascript
  var path = require('node-path-extras');
  console.log(path.contains('/a', '/a/b')); // true
```

## path.within(subPath, mainPath)

opposite to `path.contains`

```javascript
  var path = require('node-path-extras');
  console.log(path.within('/a/b', '/a')); // true
```

## path.along(aPath, bPath /*...*/)

alias `path.inpath`

```javascript
  var path = require('node-path-extras');
  console.log(path.along('/a/b/c', '/a/b', '/a/b/c/d')); // true
```

## path.isRelative(aPath)

```javascript
  var path = require('node-path-extras');
  console.log(path.isRelative('../a')); // true
  console.log(path.isRelative('/a'));   // false
```

## path.isAbsolute(aPath)

```javascript
  var path = require('node-path-extras');
  console.log(path.isAbsolute('../a')); // false
  console.log(path.isAbsolute('/a'));   // true

  // for windows
  console.log(path.isAbsolute('c:\a')); // true
```
## path.unique(arr)

remove paths in the same route in an array

```javascript
  var path = require('node-path-extras');
  console.log(path.unique(['/a/b', '/a', '/c'])); // ['/a', '/c']
```

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