Installations
npm install @hutson/parse-repository-url
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=10.13.0
Node Version
13.8.0
NPM Version
6.13.7
Score
99.8
Supply Chain
99.8
Quality
75.6
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
hyper-expanse
Download Statistics
Total Downloads
292,553,611
Last Day
361,696
Last Week
2,373,975
Last Month
9,620,545
Last Year
103,704,657
GitHub Statistics
Apache-2.0 License
111 Commits
1 Forks
1 Watchers
1 Branches
2 Contributors
Updated on Jan 28, 2023
Bundle Size
1.05 kB
Minified
565.00 B
Minified + Gzipped
Package Meta Information
Latest Version
5.0.0
Package Id
@hutson/parse-repository-url@5.0.0
Size
7.55 kB
NPM Version
6.13.7
Node Version
13.8.0
Published on
Feb 16, 2020
Total Downloads
Cumulative downloads
Total Downloads
292,553,611
Last Day
0.4%
361,696
Compared to previous day
Last Week
6.4%
2,373,975
Compared to previous week
Last Month
37.3%
9,620,545
Compared to previous month
Last Year
16.1%
103,704,657
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
5
@hutson/parse-repository-url
Parse repository URLs to extract, SCM platform, domain, user, and project information.
Occasionally you need to take a Git repository URL, such as https://gitlab.com/gitlab-org/gitlab-ce
and extract the user/group and project name from the URL for use in other tools and processes.
@hutson/parse-repository-url
helps to extract that information from many valid Git URLs strings that you might encounter, including for platforms like GitLab, GitHub, and their various use cases, such as hosted, on-premise, and multiple sub-groups.
Table of Contents
- Features
- Installation
- Usage
- Security Disclosure Policy
- Professional Support
- Debugging
- Node Support Policy
- Contributing
Features
- Return
browse
function that returns URL usable in a browser. (Similar tohosted-git-info
) - Return
domain
property containing the fully qualified domain name and port. - Return
project
property. - Return
type
property indicating the SCM host, such asgithub
orgitlab
. - Return
user
property.
*Note: Returns
null
for any property where the information could not be extracted from the repository URL.
Installation
To install the @hutson/parse-repository-url
tool for use in your project's publish process please run the following command:
1yarn add [--dev] @hutson/parse-repository-url
Usage
1const parseRepositoryURL = require(`@hutson/parse-repository-url`); 2 3/*{ 4 browse: [Function], 5 domain: 'github.com', 6 project: 'project', 7 type: 'github', 8 user: 'user' 9}*/ 10parseRepositoryURL(`https://github.com/user/project`); 11 12/*{ 13 browse: [Function], 14 domain: 'git.example.com', 15 project: 'project', 16 type: null, 17 user: 'user' 18}*/ 19parseRepositoryURL(`https://git.example.com/user/project`); 20 21/*{ 22 browse: [Function], 23 domain: 'github.com', 24 project: 'project', 25 type: 'github', 26 user: 'user' 27}*/ 28parseRepositoryURL(`git@github.com:user/project`); 29 30/*{ 31 browse: [Function], 32 domain: 'somewhere', 33 project: null, 34 type: null, 35 user: null 36}*/ 37parseRepositoryURL(`https://somewhere`);
Check out the index.spec.js
file under the src/
directory for a full list of URLs that can be parsed for GitLab, GitHub, including hosted, on-premise, and multiple sub-groups.
Security Disclosure Policy
To report a security vulnerability in this package, or one of it's dependencies, please use the Tidelift security contact page. Tidelift will coordinate the process to address the vulnerability and disclose the incident to our users.
Enterprise Support
Available as part of the Tidelift Subscription.
The maintainers of @hutson/parse-repository-url
and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
Debugging
To assist users of @hutson/parse-repository-url
with debugging the behavior of this module we use the debug utility package to print information about the publish process to the console. To enable debug message printing, the environment variable DEBUG
, which is the variable used by the debug
package, must be set to a value configured by the package containing the debug messages to be printed.
To print debug messages on a unix system set the environment variable DEBUG
with the name of this package prior to executing @hutson/parse-repository-url
:
1DEBUG=@hutson/parse-repository-url [CONSUMING TOOL]
On the Windows command line you may do:
1set DEBUG=@hutson/parse-repository-url 2[CONSUMING TOOL]
Node Support Policy
We only support Long-Term Support versions of Node.
We specifically limit our support to LTS versions of Node, not because this package won't work on other versions, but because we have a limited amount of time, and supporting LTS offers the greatest return on that investment.
It's possible this package will work correctly on newer versions of Node. It may even be possible to use this package on older versions of Node, though that's more unlikely as we'll make every effort to take advantage of features available in the oldest LTS version we support.
As each Node LTS version reaches its end-of-life we will remove that version from the node
engines
property of our package's package.json
file. Removing a Node version is considered a breaking change and will entail the publishing of a new major version of this package. We will not accept any requests to support an end-of-life version of Node. Any merge requests or issues supporting an end-of-life version of Node will be closed.
We will accept code that allows this package to run on newer, non-LTS, versions of Node. Furthermore, we will attempt to ensure our own changes work on the latest version of Node. To help in that commitment, our continuous integration setup runs against all LTS versions of Node in addition the most recent Node release; called current.
JavaScript package managers should allow you to install this package with any version of Node, with, at most, a warning if your version of Node does not fall within the range specified by our node
engines
property. If you encounter issues installing this package, please report the issue to your package manager.
Contributing
Please read our contributing guide to see how you may contribute to this project.

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.md:0
- Info: FSF or OSI recognized license: Apache License 2.0: license.md:0
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/hyper-expanse/parse-repository-url/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/hyper-expanse/parse-repository-url/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/hyper-expanse/parse-repository-url/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/hyper-expanse/parse-repository-url/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/hyper-expanse/parse-repository-url/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/hyper-expanse/parse-repository-url/main.yml/master?enable=pin
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
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
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Reason
21 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
Score
2.8
/10
Last Scanned on 2025-02-10
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 More