Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 25, 2024 via pnpm

hosted-git-info 2.1.5

Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab
Package summary
Share
2
issues
2
moderate severity
vulnerability
2
1
license
1
ISC
Package created
9 Oct 2014
Version published
17 May 2016
Maintainers
5
Total deps
1
Direct deps
0
License
ISC

Issues

2

2 moderate severity issues

moderate
Recommendation: Upgrade to version 2.8.9 or later
via: hosted-git-info@2.1.5
Recommendation: Upgrade to version 2.8.9 or later
via: hosted-git-info@2.1.5
Collapse
Expand

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
hosted-git-info@2.1.5
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
ⓘ This is a list of hosted-git-info 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does hosted-git-info do?

Hosted-git-info is a handy npm package built to provide metadata and conversions from repository urls for Git hosts like GitHub, Bitbucket, and GitLab. This utility allows you to identify and convert various Git host URLs between protocols, so you can access files directly without Git and manipulate the URLs according to your need. It can accurately match git, ssh, and https URLs—more so, ssh connect strings and shortcuts. If the URL can't be matched with a Git host, null is returned.

How do you use hosted-git-info?

The usage of the hosted-git-info npm package involves requiring the package in your JavaScript code and calling the fromUrl function with the Git repository URL as an argument. Here's an example:

const hostedGitInfo = require("hosted-git-info")
const info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts)

In the above example, info becomes an object with information about the git host, including the type of service, domain, user name, and project name.

Another example is using the file method to return a URL for directly fetching a file from the given Git host. Here, if no committish was set, HEAD is used as default.

hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")

This will return https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json.

The package also provides various other methods like shortcut, browse, bugs, docs, https, sshurl, ssh, path, tarball, getDefaultRepresentation, and toString that can be utilized per requirement.

Where are the hosted-git-info docs?

The hosted-git-info documentation and further usage details are found within its GitHub repository readme file. From explanations on the Version Contract to the detailed usage of each method, all necessary readings are provided in depth. To access the documentation, visit the repository URL: https://github.com/npm/hosted-git-info. As of this moment, this repository supports GitHub, including Gists, Bitbucket, GitLab, and Sourcehut, but pull requests for adding support to other additional hosts are always welcome.