Resolve a URI relative to an optional base URI
Installations
npm install @jridgewell/resolve-uri
Score
99.3
Supply Chain
79.7
Quality
76.7
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Developer
jridgewell
Developer Guide
Module System
CommonJS, ESM
Min. Node Version
>=6.0.0
Typescript Support
Yes
Node Version
20.10.0
NPM Version
10.2.3
Statistics
11 Stars
152 Commits
7 Forks
3 Watching
17 Branches
3 Contributors
Updated on 28 Feb 2024
Bundle Size
2.03 kB
Minified
958.00 B
Minified + Gzipped
Languages
JavaScript (99.62%)
TypeScript (0.38%)
Total Downloads
Cumulative downloads
Total Downloads
4,482,429,168
Last day
-6.9%
8,587,341
Compared to previous day
Last week
2.6%
49,724,604
Compared to previous week
Last month
-19.4%
204,990,161
Compared to previous month
Last year
36.3%
2,169,412,368
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@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
1npm install @jridgewell/resolve-uri
Usage
1function resolve(input: string, base?: string): string;
1import resolve from '@jridgewell/resolve-uri'; 2 3resolve('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 |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
8 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/jridgewell/resolve-uri/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/jridgewell/resolve-uri/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/jridgewell/resolve-uri/test.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:22
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:31
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
2.7
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @jridgewell/resolve-uri
@jridgewell/source-map
Packages @jridgewell/trace-mapping and @jridgewell/gen-mapping into the familiar source-map API
@jridgewell/gen-mapping
Generate source maps
@jridgewell/trace-mapping
Trace the original position through a source map
@jridgewell/sourcemap-codec
Encode/decode sourcemap mappings