1.0.3 • Published 9 months ago

be-url v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

be-url

Check whether a string is a URL.

Installation

npm install be-url

API

Usage

import isUrl from 'be-url'

const valid = isUrl('https://www.example.com/test.html')

isUrl(string, opt)

Returns a Boolean indicating whether string is a URL.

opt

Example: consider example.com as invalid url

{
  exclude: {
    domain: 'example.com',
  }
}

Example: consider undefined in path as invalid url

{
  exclude: {
    path: 'undefined',
  }
}

License

MIT

Credit to is-url

This library is inspired by is-url, but with more options, please refer to is-url at https://github.com/segmentio/is-url

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago