![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
is-relative-url
Advanced tools
The is-relative-url npm package is a simple utility that checks if a given URL is a relative URL. It is useful for validating and processing URLs in web development.
Check if a URL is relative
This feature allows you to check if a given URL is relative. A relative URL does not include the domain name and is relative to the current page's URL.
const isRelativeUrl = require('is-relative-url');
console.log(isRelativeUrl('/path/to/resource')); // true
console.log(isRelativeUrl('http://example.com')); // false
The is-absolute-url package checks if a given URL is an absolute URL. It complements is-relative-url by providing the opposite functionality, allowing developers to validate absolute URLs.
The url-parse package is a more comprehensive URL parsing library that can handle both relative and absolute URLs. It provides more advanced features such as extracting components of the URL, making it more versatile compared to is-relative-url.
The valid-url package provides functions to validate URLs, including checking if they are valid, absolute, or relative. It offers a broader range of validation options compared to is-relative-url.
Check if an URL is relative
$ npm install --save is-relative-url
const isRelativeUrl = require('is-relative-url');
isRelativeUrl('foo/bar');
//=> true
isRelativeUrl('http://sindresorhus.com/foo/bar');
//=> false
isRelativeUrl('//sindresorhus.com');
//=> true
See is-absolute-url for the inverse.
MIT © Sindre Sorhus
FAQs
Check if a URL is relative
The npm package is-relative-url receives a total of 0 weekly downloads. As such, is-relative-url popularity was classified as not popular.
We found that is-relative-url 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.