Skip to documentation

package

@stackline/resolve-uri 1.0.3 — installation and API

Resolve a URI relative to an optional base URI

Install @stackline/resolve-uri

npm install @stackline/[email protected]

Package version: 1.0.3. Metadata verified: 2026-11-12. This is separate from the framework version and demonstration runtime.

Node.js requirement
{"node": ">=6.0.0"}
Accepted peer dependencies (declared ranges)
{}

Tested environments are described in the versioned README and linked source checks. A declared peer range is not evidence that every version in it was tested.

Versioned reference

This reference comes from the published @stackline/[email protected] README. Its upstream attribution and license remain with the source. Benchmark and security statements describe the cited tests and advisories, not a guarantee for every application.

@stackline/resolve-uri

Resolve a URI relative to an optional base URI.

Documentation | npm | Issues | Repository

Current package version: 1.0.3


Why this package?

@stackline/resolve-uri is the Stackline-maintained distribution of @jridgewell/[email protected]. It is an independent continuation of @jridgewell/resolve-uri; original authors and licenses remain credited below.

Compatibility

Item Value
Package @stackline/[email protected]
API target @jridgewell/[email protected]
Supported Node.js >=6.0.0
License MIT
Main entry dist/resolve-uri.umd.js
Module entry dist/resolve-uri.mjs
Types dist/types/resolve-uri.d.ts
Runtime dependencies none

Installation

npm install @stackline/resolve-uri

Preserve existing imports and plugin resolution with an npm alias:

npm install @jridgewell/resolve-uri@npm:@stackline/resolve-uri

Usage and API reference

@jridgewell/resolve-uri

Resolve a URI relative to an optional base URI

Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths.

Installation

npm install @stackline/resolve-uri

Usage

function resolve(input: string, base?: string): string;
import resolve from '@stackline/resolve-uri';

resolve('foo', 'https://example.com'); // => 'https://example.com/foo'
Input Base Resolution Explanation
https://example.com any https://example.com/ Input is normalized only
//example.com https://base.com/ https://example.com/ Input inherits the base's protocol
//example.com rest //example.com/ Input is normalized only
/example https://base.com/ https://base.com/example Input inherits the base's origin
/example //base.com/ //base.com/example Input inherits the base's host and remains protocol relative
/example rest /example Input is normalized only
example https://base.com/dir/ https://base.com/dir/example Input is joined with the base
example https://base.com/file https://base.com/example Input is joined with the base without its file
example //base.com/dir/ //base.com/dir/example Input is joined with the base's last directory
example //base.com/file //base.com/example Input is joined with the base without its file
example /base/dir/ /base/dir/example Input is joined with the base's last directory
example /base/file /base/example Input is joined with the base without its file
example base/dir/ base/dir/example Input is joined with the base's last directory
example base/file base/example Input is joined with the base without its file

Credits and original authors

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

License

MIT. See the license and notice files in the repository.

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.