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

parse-github-url

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-github-url

Parse a github URL into an object.

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
825K
decreased by-37.48%
Maintainers
3
Weekly downloads
 
Created

What is parse-github-url?

The parse-github-url npm package is a utility for parsing GitHub repository URLs into their component parts. It helps in extracting information such as the owner, repository name, branch, and file path from a given GitHub URL.

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

Parse GitHub URL

This feature allows you to parse a GitHub URL and extract its components such as the owner, repository name, and more. The code sample demonstrates how to use the package to parse a GitHub URL and log the parsed components.

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

Extract Owner and Repository

This feature allows you to specifically extract the owner and repository name from a GitHub URL. The code sample shows how to parse the URL and log the owner and repository name.

const parse = require('parse-github-url');
const { owner, name } = parse('https://github.com/IonicaBizau/parse-github-url');
console.log(`Owner: ${owner}, Repository: ${name}`);

Handle Different URL Formats

This feature demonstrates the package's ability to handle different GitHub URL formats, including those with different protocols and extensions. The code sample shows how to parse a URL with the 'git+' protocol and '.git' extension.

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

Other packages similar to parse-github-url

Keywords

FAQs

Package last updated on 06 Sep 2016

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