
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@anymud/uri
Advanced tools
A JavaScript library for parsing, resolving, and stringifying Uniform Resource Identifiers (URIs).
A lightweight JavaScript library for handling Uniform Resource Identifiers (URIs) efficiently.
You can install the @anymud/uri package via npm, yarn, pnpm or bun:
# npm
npm install @anymud/uri
#yarn
yarn add @anymud/uri
# pnpm
npm install @anymud/uri
# bun
bun install @anymud/uri
You can import the library in your JavaScript/TypeScript files as follows:
import * as uri from '@anymud/uri';
parseUri(uri: string): UriComponentsThis function parses a URI string and returns its components as an object conforming to the UriComponents interface.
resolveUri(baseComponents: UriComponentsInput, relativeComponents: UriComponentsInput): UriComponentsThis function resolves a relative URI against a base URI and returns the resulting URI components.
toString(components: UriComponentsInput): stringConverts a URI components object into a URI string.
getSubdomain(components: RequiredComponent<'host'>, tlds: string[] = KnownTlds): stringExtracts the subdomain from the host component of a URI.
Full Reference: https://anymud.github.io/uri/
import { parseUri, resolveUri, toString } from '@anymud/uri';
const uriString = 'https://www.example.com/path/to/resource?query=123#fragment';
const parsedUri = parseUri(uriString);
console.log(parsedUri);
const baseUri = {
scheme: 'https',
host: 'www.example.com',
path: '/base',
};
const relativeUri = {
path: 'path/to/resource',
query: 'query=123',
fragment: 'fragment',
};
const resolvedUri = resolveUri(baseUri, relativeUri);
console.log(resolvedUri);
const uriString = toString(resolvedUri);
console.log(uriString);
This library is released under the MIT License. See the LICENSE file for details.
FAQs
A JavaScript library for parsing, resolving, and stringifying Uniform Resource Identifiers (URIs).
The npm package @anymud/uri receives a total of 13 weekly downloads. As such, @anymud/uri popularity was classified as not popular.
We found that @anymud/uri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.