npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

is-relative-url

3.0.0 • Public • Published

is-relative-url Build Status

Check if an URL is relative

Install

$ npm install is-relative-url

Usage

const isRelativeUrl = require('is-relative-url');
 
isRelativeUrl('foo/bar');
//=> true
 
isRelativeUrl('https://sindresorhus.com/foo/bar');
//=> false
 
isRelativeUrl('//sindresorhus.com');
//=> true

Related

See is-absolute-url for the inverse.

License

MIT © Sindre Sorhus

install

npm i is-relative-url

Downloadsweekly downloads

168,965

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability