url-http
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

url-http

Last version Coverage Status NPM Status

Get input as normalized WHATWG URL.

Install

$ npm install url-http --save

Usage

const urlHttp = require('url-http')

!!urlHttp('https://kikobeats.com') // ==> true
!!urlHttp('https://kikobeats.com') // ==> true
!!urlHttp('mailto://kiko@beats.com') // ==> false
!!urlHttp('callto:192.168.103.77+type=ip') // ==> false

If you need to run the package in a browser environment, you can save some bytes using the lightweight version:

const urlHttp = require('url-http/lightweight')

!!urlHttp('https://kikobeats.com') // ==> true
!!urlHttp('https://kikobeats.com') // ==> true
!!urlHttp('mailto://kiko@beats.com') // ==> false
!!urlHttp('callto:192.168.103.77+type=ip') // ==> false

License

url-http © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · X @Kikobeats

Dependencies (3)

Dev Dependencies (14)

Package Sidebar

Install

npm i url-http

Weekly Downloads

18,667

Version

1.3.0

License

MIT

Unpacked Size

6.26 kB

Total Files

6

Last publish

Collaborators

  • kikobeats