🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

git-url-parse

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-url-parse

A high level git url parser for common git providers.

11.3.0
Source
npm
Version published
Weekly downloads
5.1M
-19.2%
Maintainers
1
Weekly downloads
 
Created

What is git-url-parse?

The git-url-parse npm package is a utility for parsing Git URLs and extracting useful information from them. It supports various Git URL formats and provides methods to manipulate and retrieve different parts of the URL.

What are git-url-parse's main functionalities?

Parsing a Git URL

This feature allows you to parse a Git URL and get an object containing various parts of the URL such as the protocol, source, owner, name, and more.

const gitUrlParse = require('git-url-parse');
const parsed = gitUrlParse('https://github.com/IonicaBizau/git-url-parse.git');
console.log(parsed);

Extracting the owner and name

This feature allows you to extract specific parts of the Git URL, such as the owner and repository name.

const gitUrlParse = require('git-url-parse');
const parsed = gitUrlParse('https://github.com/IonicaBizau/git-url-parse.git');
console.log(parsed.owner); // 'IonicaBizau'
console.log(parsed.name); // 'git-url-parse'

Converting to a different URL format

This feature allows you to convert a Git URL from one format to another, such as from HTTPS to SSH.

const gitUrlParse = require('git-url-parse');
const parsed = gitUrlParse('https://github.com/IonicaBizau/git-url-parse.git');
const sshUrl = parsed.toString('ssh');
console.log(sshUrl); // 'git@github.com:IonicaBizau/git-url-parse.git'

Other packages similar to git-url-parse

Keywords

parse

FAQs

Package last updated on 30 Sep 2020

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