Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github-url-from-git

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-url-from-git

Parse a github git url and return the github repo url

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
157K
decreased by-56.42%
Maintainers
1
Weekly downloads
 
Created

What is github-url-from-git?

The 'github-url-from-git' npm package is a utility that helps convert Git URLs to GitHub URLs. This can be particularly useful for developers who need to transform repository URLs for various purposes, such as generating links for documentation or automating workflows.

What are github-url-from-git's main functionalities?

Convert Git URL to GitHub URL

This feature allows you to convert a Git URL (SSH format) to a GitHub URL (HTTPS format). This is useful for creating web links from repository URLs.

const githubUrlFromGit = require('github-url-from-git');
const gitUrl = 'git@github.com:user/repo.git';
const githubUrl = githubUrlFromGit(gitUrl);
console.log(githubUrl); // Outputs: 'https://github.com/user/repo'

Handle different Git URL formats

This feature demonstrates the package's ability to handle different Git URL formats, converting both SSH and HTTPS Git URLs to a standard GitHub URL.

const githubUrlFromGit = require('github-url-from-git');
const gitUrl1 = 'git@github.com:user/repo.git';
const gitUrl2 = 'https://github.com/user/repo.git';
const githubUrl1 = githubUrlFromGit(gitUrl1);
const githubUrl2 = githubUrlFromGit(gitUrl2);
console.log(githubUrl1); // Outputs: 'https://github.com/user/repo'
console.log(githubUrl2); // Outputs: 'https://github.com/user/repo'

Other packages similar to github-url-from-git

Keywords

FAQs

Package last updated on 23 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc