node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

is-absolute-url

is-absolute-url Build Status

Check if an URL is absolute

Install

$ npm install --save is-absolute-url

Usage

var isAbsoluteUrl = require('is-absolute-url');
 
isAbsoluteUrl('http://sindresorhus.com/foo/bar');
//=> true 
 
isAbsoluteUrl('//sindresorhus.com');
//=> false 
 
isAbsoluteUrl('foo/bar');
//=> false 

Related

See is-relative-url for the inverse.

License

MIT © Sindre Sorhus