Gathering detailed insights and metrics for mos-hosted-git-info
Gathering detailed insights and metrics for mos-hosted-git-info
Gathering detailed insights and metrics for mos-hosted-git-info
Gathering detailed insights and metrics for mos-hosted-git-info
Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab
npm install mos-hosted-git-info
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
1 Stars
172 Commits
1 Forks
2 Watchers
8 Branches
38 Contributors
Updated on Feb 05, 2024
Latest Version
1.0.0
Package Id
mos-hosted-git-info@1.0.0
Size
6.77 kB
NPM Version
2.15.5
Node Version
4.4.5
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab
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.
This module is installed via npm:
1npm install @zkochan/hosted-git-info --save
1var hostedGitInfo = require('@zkochan/hosted-git-info') 2var info = hostedGitInfo.fromUrl('git@github.com:npm/hosted-git-info.git') 3console.log([info.type, info.domain, info.user, info.project].join('\n')) 4//> github 5// github.com 6// npm 7// hosted-git-info
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:
master
will be used as the default.
For example1var url = hostedGitInfo.fromUrl('git@github.com:npm/hosted-git-info.git#v1.0.0').file('package.json') 2console.log(url) 3//> https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json 4 5console.log(info.shortcut()) 6//> github:npm/hosted-git-info 7 8console.log(info.browse()) 9//> https://github.com/npm/hosted-git-info 10 11console.log(info.bugs()) 12//> https://github.com/npm/hosted-git-info/issues 13 14console.log(info.docs()) 15//> https://github.com/npm/hosted-git-info#readme 16 17console.log(info.https()) 18//> git+https://github.com/npm/hosted-git-info.git 19 20console.log(info.sshurl()) 21//> git+ssh://git@github.com/npm/hosted-git-info.git 22 23console.log(info.ssh()) 24//> git@github.com:npm/hosted-git-info.git 25 26console.log(info.path()) 27//> npm/hosted-git-info 28 29console.log(info.getDefaultRepresentation()) 30//> sshurl
Returns the default output type. The default output type is based on the string you passed in to be parsed
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, Bitbucket and Gitlab. Pull requests for additional hosts welcome.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
25 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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