Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
url-relative
Advanced tools
calculate RFC 1808 relative URLs (inverse of url.resolve)
var urlRelative = require('url-relative')
urlRelative('http://foo.com/a/b','http://foo.com/c/d')
// => '../c/d'
urlRelative('/a/b', '/a/b/c')
// => 'b/c'
urlRelative : (from : String, to : String) => String
Returns the shortest relative URL difference between a from
and a to
URL. Relative URLs are described in RFC 1808.
from
and two
can be full URLs (e.g. http://foo.com/bar
), network location URLs (protocol-relative, e.g. //foo.com/bar
), or absolute path URLs (e.g. /bar
).
$ npm install url-relative
From package root:
$ npm install
$ npm test
ISC. (c) MMXV jden jason@denizac.org. See LICENSE.md
FAQs
calculate RFC 1808 relative URLs (inverse of url.resolve)
The npm package url-relative receives a total of 34 weekly downloads. As such, url-relative popularity was classified as not popular.
We found that url-relative demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.