resolve-pathname
resolve-pathname 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 npm:
Then, use as you would anything else:
The UMD build is also available on unpkg:
You can find the library on window.resolvePathname
.
Usage
Prior Work
url.resolve - node's
url.resolve
implementation for full URLsresolve-url - A DOM-dependent implementation of the same algorithm
Last updated