Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

url-http

Kikobeats19.1kMIT1.3.1TypeScript support: included

Get input as normalized WHATWG URL

http, https, url, whatwg

readme

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

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.3.1 (2025-05-27)

1.3.0 (2024-11-03)

Features

1.2.3 (2024-10-30)

1.2.2 (2024-06-03)

1.2.1 (2024-05-09)

1.2.0 (2024-02-14)

Features

1.1.3 (2023-10-24)

1.1.2 (2023-09-07)

1.1.1 (2023-09-04)

1.1.0 (2023-09-04)

⚠ BREAKING CHANGES

  • just use URL (#9)

Bug Fixes

1.0.15 (2023-09-04)

1.0.14 (2023-08-16)

1.0.13 (2023-07-31)

1.0.12 (2023-05-26)

1.0.11 (2023-05-10)

1.0.10 (2023-05-10)

1.0.9 (2023-03-28)

1.0.8 (2022-12-12)

1.0.7 (2022-06-14)

1.0.6 (2022-06-14)

Bug Fixes

1.0.5 (2022-06-14)

1.0.4 (2022-06-14)

1.0.3 (2022-05-16)

1.0.2 (2022-04-28)

1.0.1 (2022-04-27)

Bug Fixes

1.0.0 (2022-04-27)