parse-domain

Splits a hostname into subdomains, domain and (effective) top-level domains

html-segmentator

A small library for splitting an HTML string into its top-level sections. Based on html5parser.