is-absolute-url

  • Version 4.0.1
  • Published
  • 3.52 kB
  • No dependencies
  • MIT license

Install

npm i is-absolute-url
yarn add is-absolute-url
pnpm add is-absolute-url

Overview

Check if a URL is absolute

Index

Functions

function isAbsoluteUrl

isAbsoluteUrl: (url: string) => boolean;
  • Check if a URL is absolute.

    Parameter url

    The URL to check.

    Example 1

    import isAbsoluteUrl from 'is-absolute-url';
    isAbsoluteUrl('http://sindresorhus.com/foo/bar');
    //=> true
    isAbsoluteUrl('//sindresorhus.com');
    //=> false
    isAbsoluteUrl('foo/bar');
    //=> false

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (3)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/is-absolute-url.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/is-absolute-url)
  • HTML
    <a href="https://www.jsdocs.io/package/is-absolute-url"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>