is-url-superb

Check if a string is a URL

MIT 8 个版本
安装
npm install is-url-superb
yarn add is-url-superb
pnpm add is-url-superb
bun add is-url-superb
README

is-url-superb

Check if a string is a URL

Install

$ npm install is-url-superb

Usage

import isUrl from 'is-url-superb';

isUrl('https://sindresorhus.com');
//=> true

isUrl('unicorn');
//=> false

API

isUrl(string, options?)

options

Type: object

lenient

Type: boolean
Default: false

Allow URLs without a protocol.

import isUrl from 'is-url-superb';

isUrl('example.com');
//=> false

isUrl('example.com', {lenient: true});
//=> true
  • is - Type check values
版本列表
6.1.0 2021-11-01
6.0.0 2021-04-17
5.0.0 2020-11-29
4.0.0 2020-06-14
3.0.0 2019-04-21
2.0.0 2015-06-22
1.0.1 2014-11-26
1.0.0 2014-11-26