Check if a URL is absolute
$ npm install is-absolute-url
const isAbsoluteUrl = require('is-absolute-url');
isAbsoluteUrl('https://sindresorhus.com/foo/bar');
//=> true
isAbsoluteUrl('//sindresorhus.com');
//=> false
isAbsoluteUrl('foo/bar');
//=> false
See is-relative-url for the inverse.