![]() |
VOOZH | about |
parseUri
👁 GitHub// URL parser
parseUri is a mighty but tiny (1KB) JavaScript URI/URN/URL parser that splits any
URI into its parts (all of which are optional). Its combination of accuracy, comprehensiveness,
and brevity is unrivaled. This demo page allows you to test its results and compare with
JavaScript’s built-in URL
constructor and URI.js (a much larger
library).
Modes:
parseUri has two parsing modes: default and friendly. Usually they produce the
same result, but the default mode follows official URI standards and friendly mode allows
handling human-friendly URLs like 'example.com/file.html' as expected. More
specifically, friendly mode doesn’t require <protocol>:, :,
//, or other repeating slashes to signal the start of an authority, but this also
precludes it from properly handling relative paths (no leading / or
\) such as 'dir/file.html'.
Options:
| Key | parseUri [default] |
|---|