You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
632 B

4 years ago
  1. # is-absolute-url [![Build Status](https://travis-ci.org/sindresorhus/is-absolute-url.svg?branch=master)](https://travis-ci.org/sindresorhus/is-absolute-url)
  2. > Check if an URL is absolute
  3. ## Install
  4. ```sh
  5. $ npm install --save is-absolute-url
  6. ```
  7. ## Usage
  8. ```js
  9. var isAbsoluteUrl = require('is-absolute-url');
  10. isAbsoluteUrl('http://sindresorhus.com/foo/bar');
  11. //=> true
  12. isAbsoluteUrl('//sindresorhus.com');
  13. //=> false
  14. isAbsoluteUrl('foo/bar');
  15. //=> false
  16. ```
  17. ## Related
  18. See [is-relative-url](https://github.com/sindresorhus/is-relative-url) for the inverse.
  19. ## License
  20. MIT © [Sindre Sorhus](http://sindresorhus.com)