is-absolute-url

Check if a URL is absolute

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
is-absolute-url
4.0.13 years ago10 years agoMinified + gzip package size for is-absolute-url in KB

Readme

is-absolute-url
Check if a URL is absolute

Install

$ npm install is-absolute-url

Usage

import isAbsoluteUrl from 'is-absolute-url';

isAbsoluteUrl('https://sindresorhus.com/foo/bar');
//=> true

isAbsoluteUrl('//sindresorhus.com');
//=> false

isAbsoluteUrl('foo/bar');
//=> false

Related

See is-relative-url for the inverse.
<b>
	<a href="https://tidelift.com/subscription/pkg/npm-is-absolute-url?utm_source=npm-is-absolute-url&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
	Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>