xurl

a simple url parser

Usage no npm install needed!

<script type="module">
  import xurl from 'https://cdn.skypack.dev/xurl';
</script>

README

xURL

Build Status

usage:

var xURL = require('xurl');
xURL('http://www.google.com:8080/index.html?qs#hash');

/* returns:
{
  "protocol": "http:",
  "host": "www.google.com:8080",
  "hostname": "www.google.com",
  "port": "8080",
  "pathname": "/index.html",
  "search": "?qs",
  "hash": "#hash",
  "href": "http://www.google.com:8080/index.html?qs#hash"
}
*/