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

Package detail

url-ext

perzy12MIT0.1.1

core url lib extension

url, extension

readme

url-ext

Core url lib extension. NPM version

Installation

$ npm install --save url-ext

Usage

var urlExt = require('url-ext');
var url = 'http://www.xxx.com:8080/search?q=jerrywu#hello';
var hostnameWithProtocol = urlExt.parseHostnameWithProtocol(url);
console.log('hostnameWithProtocol: %s', hostnameWithProtocol); // http://www.xxx.com

License

The MIT License.