# @cush/relative

> Fast relative path resolution

Latest version **1.0.0** (published 2021-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cush/relative
pnpm add @cush/relative
yarn add @cush/relative
bun add @cush/relative
```

## 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 | 2021-04-01 |
| First published | 2018-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | aleclarson |
| Keywords | path, resolve, resolution, relative, fs |

## Links

- npm: https://www.npmjs.com/package/@cush/relative
- Repository: https://github.com/aleclarson/relative
- Homepage: https://github.com/aleclarson/relative#readme
- Issues: https://github.com/aleclarson/relative/issues
- npm.io page: https://npm.io/package/@cush/relative

## 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) — 2021-04-01
- 0.1.0 — 2018-11-19
- 0.0.1 — 2018-06-25

## README

# @cush/relative

[![npm](https://img.shields.io/npm/v/@cush/relative.svg)](https://www.npmjs.com/package/@cush/relative)
[![Bundle size](https://badgen.net/bundlephobia/min/@cush/relative)](https://bundlephobia.com/result?p=@cush/relative)
[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)

Ultra fast relative path resolver ⚡️

```js
relative('a/b', './c')    // => 'a/c'
relative('a/b', '.')      // => 'a'
relative('a/b', '..')     // => ''
relative('a/b', '../..')  // => null
```

The first argument is known as "the module".

The second argument is known as "the relative".

The relative must begin with a period. Otherwise, `null` is returned.

The basename of the module is always ignored.

When the module is *not* absolute and the relative is pointing to the root directory, an empty string is returned.

When the module is *not* absolute and the relative is pointing outside the root directory, `null` is returned.

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