Gathering detailed insights and metrics for hosted-git-info
Gathering detailed insights and metrics for hosted-git-info
Gathering detailed insights and metrics for hosted-git-info
Gathering detailed insights and metrics for hosted-git-info
@types/hosted-git-info
TypeScript definitions for hosted-git-info
@zkochan/hosted-git-info
Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab
mos-hosted-git-info
Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab
hosted-git-info-fixed
Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab
Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab
npm install hosted-git-info
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
100
Quality
85.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
9,989,060,149
Last Day
10,151,646
Last Week
55,478,786
Last Month
227,257,938
Last Year
2,530,054,073
ISC License
219 Stars
268 Commits
86 Forks
29 Watchers
8 Branches
95 Contributors
Updated on Jan 03, 2025
Minified
Minified + Gzipped
Latest Version
8.0.2
Package Id
hosted-git-info@8.0.2
Unpacked Size
26.17 kB
Size
7.37 kB
File Count
7
NPM Version
10.9.0
Node Version
22.11.0
Published on
Nov 21, 2024
Cumulative downloads
Total Downloads
Last Day
2.4%
10,151,646
Compared to previous day
Last Week
3.7%
55,478,786
Compared to previous week
Last Month
37.3%
227,257,938
Compared to previous month
Last Year
11.2%
2,530,054,073
Compared to previous year
1
3
This will let you identify and transform various git hosts URLs between protocols. It also can tell you what the URL is for the raw path for particular file for direct access without git.
1const hostedGitInfo = require("hosted-git-info") 2const info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) 3/* info looks like: 4{ 5 type: "github", 6 domain: "github.com", 7 user: "npm", 8 project: "hosted-git-info" 9} 10*/
If the URL can't be matched with a git host, null
will be returned. We
can match git, ssh and https urls. Additionally, we can match ssh connect
strings (git@github.com:npm/hosted-git-info
) and shortcuts (eg,
github:npm/hosted-git-info
). GitHub specifically, is detected in the case
of a third, unprefixed, form: npm/hosted-git-info
.
If it does match, the returned object has properties of:
The major version will be bumped any time…
Implications:
.https()
to be a part of the contract. The contract is that it will
return a string that can be used to fetch the repo via HTTPS. But what
that string looks like, specifically, can change.git+
won't be prefixed on URLs.All of the methods take the same options as the fromUrl
factory. Options
provided to a method override those provided to the constructor.
Given the path of a file relative to the repository, returns a URL for
directly fetching it from the githost. If no committish was set then
HEAD
will be used as the default.
For example hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")
would return https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json
eg, github:npm/hosted-git-info
eg, https://github.com/npm/hosted-git-info/tree/v1.2.0
,
https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json
,
https://github.com/npm/hosted-git-info/tree/v1.2.0/README.md#supported-hosts
eg, https://github.com/npm/hosted-git-info/issues
eg, https://github.com/npm/hosted-git-info/tree/v1.2.0#readme
eg, git+https://github.com/npm/hosted-git-info.git
eg, git+ssh://git@github.com/npm/hosted-git-info.git
eg, git@github.com:npm/hosted-git-info.git
eg, npm/hosted-git-info
eg, https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz
Returns the default output type. The default output type is based on the string you passed in to be parsed
Uses the getDefaultRepresentation to call one of the other methods to get a URL for
this resource. As such hostedGitInfo.fromUrl(url).toString()
will give
you a normalized version of the URL that still uses the same protocol.
Shortcuts will still be returned as shortcuts, but the special case github
form of org/project
will be normalized to github:org/project
.
SSH connect strings will be normalized into git+ssh
URLs.
Currently this supports GitHub (including Gists), Bitbucket, GitLab and Sourcehut. Pull requests for additional hosts welcome.
Stable Version
2
5.3/10
Summary
Regular Expression Denial of Service in hosted-git-info
Affected Versions
< 2.8.9
Patched Versions
2.8.9
5.3/10
Summary
Regular Expression Denial of Service in hosted-git-info
Affected Versions
>= 3.0.0, < 3.0.8
Patched Versions
3.0.8
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no dangerous workflow patterns detected
Reason
SAST tool detected but not run on all commits
Details
Reason
7 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 6
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
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