githubEdit

resolve-pathname

resolve-pathnamearrow-up-right resolves URL pathnames identical to the way browsers resolve the pathname of an <a href> value. The goals are:

  • 100% compatibility with browser pathname resolution

  • Pure JavaScript implementation (no DOM dependency)

Installation

Using npmarrow-up-right:

$ npm install --save resolve-pathname

Then, use as you would anything else:

// using ES6 modules
import resolvePathname from 'resolve-pathname';

// using CommonJS modules
var resolvePathname = require('resolve-pathname');

The UMD build is also available on unpkgarrow-up-right:

<script src="https://unpkg.com/resolve-pathname"></script>

You can find the library on window.resolvePathname.

Usage

Prior Work

Last updated

Was this helpful?