@xesam/url
v0.1.2
Published
使用 Javascript 正则解析 URL 字符串(Parse url string with RegExp)
Downloads
79
Readme
@xesam/url
Parse url string with RegExp.
npm install @xesam/url
Usage
Usage:
const url = require('@xesam/url');
const comps = url('https://admin:[email protected]:80/abc/def?name=xesam#fragment?a=b#c=d');
Output:
{
protocol: 'https:',
auth: 'admin:root',
host: 'www.chelaile.net.cn:80',
hostname: 'www.chelaile.net.cn',
port: '80',
pathname: '/abc/def',
search: '?name=xesam',
query: 'name=xesam',
hash: '#fragment?a=b#c=d'
}