An open API service indexing awesome lists of open source software.

https://github.com/digitaledgeit/js-url.relative

Get the relative path from one URL to another URL.
https://github.com/digitaledgeit/js-url.relative

Last synced: 8 months ago
JSON representation

Get the relative path from one URL to another URL.

Awesome Lists containing this project

README

          

# url.relative

Get a relative path from one URL to another URL.

## Installation

npm install --save url.relative

## Example

var relative = require('url.relative');

from = 'http://example.com/foo/bar';
to = 'http://example.com/style.css';

relative(from, to) // ==> '../style.css'