@opsimathically/urlparser
v0.0.1
Published
Set project description.
Maintainers
Readme
URLParser
URL parser intended to parse a variety of URL like things. Basically, anything that would show up in an anchor. Things like http/https links, mailto, tel, about, various schemas. I also have a good number of fuzzers, validators, etc in this project, but the primary function of this library is that I can shove a URL-like into it and get back uniform parsed data.
Important Note: The data types and structures are likely to change in the future as my needs expand. This library is intended for my purposes, which will likely change depending on what I need/want.
// create urlparser instance and parse a url. The result is a type union
// which structurally will vary based on the result type.
const urlparser = new URLParser();
const parse_result = urlparser.parse(url);
// just switch and do whatever you need here
switch (parse_result?.type) {
/* handle types here */
default:
break;
}Install
npm install @opsimathically/urlparserBuilding from source
This package is intended to be run via npm, but if you'd like to build from source,
clone this repo, enter directory, and run npm install for dev dependencies, then run
npm run build.
