Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including is-absolute-url with all npm packages installed. Try it out:

var isAbsoluteUrl = require("is-absolute-url")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

is-absolute-url v3.0.3

Check if a URL is absolute

is-absolute-url Build Status

Check if a URL is absolute

Install

$ npm install is-absolute-url

Usage

const isAbsoluteUrl = require('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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free