Edit (2024): parseUri has had a major update and is now available on GitHub and npm I've just updated parseUri. If you haven't seen the older version, parseUri is a function which splits any well-formed URI into its parts, all of which are optional. Its combination of accuracy, flexibility, and brevity is unrivaled. Highlights: Comprehensively splits URIs, including splitting the query string into