Skip to content
Check if a URL is absolute
JavaScript TypeScript
Branch: master
Clone or download
Latest commit 8a57cce Sep 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Tidelift tasks Sep 10, 2019
.editorconfig Require Node.js 8, add TypeScript definition (#6) Apr 6, 2019
.gitattributes Require Node.js 8, add TypeScript definition (#6) Apr 6, 2019
.gitignore Require Node.js 8, add TypeScript definition (#6) Apr 6, 2019
.npmrc Require Node.js 8, add TypeScript definition (#6) Apr 6, 2019
.travis.yml Require Node.js 8, add TypeScript definition (#6) Apr 6, 2019
index.d.ts Fix typo Apr 21, 2019
index.js Ignore case when testing scheme (#9) Sep 29, 2019
index.test-d.ts Meta tweaks Apr 6, 2019
license Require Node.js 8, add TypeScript definition (#6) Apr 6, 2019
package.json 3.0.3 Sep 29, 2019
readme.md Tidelift tasks Sep 10, 2019
test.js

readme.md

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.
You can’t perform that action at this time.