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

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

Current Tags

  • 3.0.0                                ...           latest (6 years ago)

2 Versions

  • 2.0.0                                ...           10 years ago
  • 3.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org