is-relative-url
Check if an URL is relative
Last updated 12 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-relative-url 
SYNC missed versions from official npm registry.

is-relative-url

Check if a URL is relative

Install

npm install is-relative-url

Usage

import isRelativeUrl from '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.

Current Tags

  • 4.1.1                                ...           latest (3 months ago)

8 Versions

  • 4.1.1                                ...           3 months ago
  • 4.1.0                                ...           a year ago
  • 4.0.0                                ...           4 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.0                                ...           11 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 23
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 1
Last Month 8
Dependencies (1)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE