# next-path

> One step closer to your destination.

Latest version **1.0.0** (published 2017-02-05) · MPL-2.0 license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2017-02-05 |
| First published | 2016-08-11 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Seth Holladay |
| Maintainers | sholladay |
| Keywords | add, concat, next, path, paths, segment, component, resolve, distance, between, relative, dir, directory, file |

## Links

- npm: https://www.npmjs.com/package/next-path
- Repository: https://github.com/sholladay/next-path
- Issues: https://github.com/sholladay/next-path/issues
- npm.io page: https://npm.io/package/next-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) — 2017-02-05
- 0.1.0 — 2016-08-11

## README

# next-path [![Build status for next-path on Circle CI.](https://img.shields.io/circleci/project/sholladay/next-path/master.svg "Circle Build Status")](https://circleci.com/gh/sholladay/next-path "Next Path Builds")

> One step closer to your destination.

Like an incremental [`path.relative()`](https://nodejs.org/api/path.html#path_path_relative_from_to "Compute the path from one place to another.").

## Why?

 - Walk the file system without messy state.
 - Works well with functional programming styles.
 - Flexible about user input.

## Install

```sh
npm install next-path --save
```

## Usage

Get it into your program.

```js
const nextPath = require('next-path');
```

Determine the next path, one step closer to the destination.

```js
console.log(nextPath('a', 'a/b/c'));  // => 'a/b'
console.log(nextPath('../', '../../../'));  // => '../..'
```

## API

### nextPath(from, to)

#### from

Type: `string`

The base path that both `to` and the result will be relative to.

#### to

Type: `string`

The path you want to move one step closer to.

## Contributing

See our [contributing guidelines](https://github.com/sholladay/next-path/blob/master/CONTRIBUTING.md "The guidelines for participating in this project.") for more details.

1. [Fork it](https://github.com/sholladay/next-path/fork).
2. Make a feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. [Submit a pull request](https://github.com/sholladay/next-path/compare "Submit code to this project for review.").

## License

[MPL-2.0](https://github.com/sholladay/next-path/blob/master/LICENSE "The license for next-path.") © [Seth Holladay](http://seth-holladay.com "Author of next-path.")

Go make something, dang it.

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