urlite is a minimal, dependency-free URL parser and formatter for Node.js and browsers, optimized for size and speed. Version 3.1.0 compresses to under 1 kB minified and achieves over 2 million parse operations per second—outperforming most alternatives. It uses a single regex to extract URL components in one pass. An 'extra' entry point adds querystring, hash, and auth parsing/formatting. Ship TypeScript definitions. Ideal when bundle size and parsing performance are critical.
npm install urliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parse a URL with auth, port, path, query, and hash; then format back to original string.
Strip '#' manually: parsed.hash.slice(1) or use urlite/extra for parsed hash object.
Strip '?' manually: parsed.search.slice(1) or use urlite/extra for parsed search object.
Clone the parsed object before mutation or re-parse if you need to modify search/hash.
If you need normalization, handle it manually after parsing.
Change `import { parse } from 'urlite'` to `import urlite from 'urlite'`, then use `urlite.parse()`.Ensure you are using version 3.1.0+ which includes the extra subpath. Also check that your bundler supports package.json 'exports' field. Use `require('urlite/extra')` or a full path fallback.Check for existence: `parsed.hash && parsed.hash.slice(1)` or use optional chaining: `parsed.hash?.slice(1)`.
No dependency data recorded yet.