![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
git-url-parse
Advanced tools
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.
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'
The parse-github-url package is a utility for parsing GitHub URLs specifically. It extracts information such as the owner, repository name, and branch. Compared to git-url-parse, it is more focused on GitHub URLs and may not support other Git hosting services.
The git-url package provides similar functionality for parsing and manipulating Git URLs. It offers methods to extract parts of the URL and convert between different URL formats. It is comparable to git-url-parse in terms of functionality but may have different API design and usage patterns.
The url-parse package is a more general-purpose URL parsing library that can handle various types of URLs, not just Git URLs. While it can be used to parse Git URLs, it does not provide Git-specific methods and properties like git-url-parse does.
A high level git url parser for common git providers.
$ npm i --save git-url-parse
// Dependencies
const GitUrlParse = require("git-url-parse");
console.log(GitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git"));
// => {
// protocols: []
// , port: null
// , resource: "github.com"
// , user: "git"
// , pathname: "/IonicaBizau/node-git-url-parse.git"
// , hash: ""
// , search: ""
// , href: "git@github.com:IonicaBizau/node-git-url-parse.git"
// , token: ""
// , protocol: "ssh"
// , toString: [Function]
// , source: "github.com"
// , name: "node-git-url-parse"
// , owner: "IonicaBizau"
// }
console.log(GitUrlParse("https://github.com/IonicaBizau/node-git-url-parse.git"));
// => {
// protocols: ["https"]
// , port: null
// , resource: "github.com"
// , user: ""
// , pathname: "/IonicaBizau/node-git-url-parse.git"
// , hash: ""
// , search: ""
// , href: "https://github.com/IonicaBizau/node-git-url-parse.git"
// , token: ""
// , protocol: "https"
// , toString: [Function]
// , source: "github.com"
// , name: "node-git-url-parse"
// , owner: "IonicaBizau"
// }
console.log(GitUrlParse("https://github.com/IonicaBizau/node-git-url-parse.git").toString("ssh"));
// => "git@github.com:IonicaBizau/node-git-url-parse.git"
console.log(GitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git").toString("https"));
// => "https://github.com/IonicaBizau/node-git-url-parse.git"
There are few ways to get help:
gitUrlParse(url)
Parses a Git url.
url
: The Git url to parse.GitUrl
object containing:protocols
(Array): An array with the url protocols (usually it has one element).port
(null|Number): The domain port.resource
(String): The url domain (including subdomains).user
(String): The authentication user (usually for ssh urls).pathname
(String): The url pathname.hash
(String): The url hash.search
(String): The url querystring value.href
(String): The input url.protocol
(String): The git url protocol.token
(String): The oauth token (could appear in the https urls).source
(String): The Git provider (e.g. "github.com"
).owner
(String): The repository owner.name
(String): The repository name.full_name
(String): The owner and name values in the owner/name
format.toString
(Function): A function to stringify the parsed url into another url type.organization
(String): The organization the owner belongs to. This is CloudForge specific.stringify(obj, type)
Stringifies a GitUrl
object.
obj
: The parsed Git url object.type
: The type of the stringified url (default obj.protocol
).Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—You can make one-time donations via PayPal. I'll probably buy a
coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
autorelease-setup
(by Tyler Johnson)—A CLI tool for setting up a repository with autorelease.branch-release
(by Roman Hotsiy)—Build and tag package realease on a separate branchchangelog.md
(by EGOIST)—Manage CHANGELOG.md so easy it hurts.ci-yarn-upgrade
(by taichi)—Keep NPM dependencies up-to-date with CI, providing version-to-version diff for each librarycomplan
(by Pranav Parikh)—COMPLexity ANalyzer Tool For Javascriptdocula-ui
—Express.js bindings for Docula projectdocula-ui-express
—Express.js bindings for Docula projectdocumentation
(by Tom MacWright)—a documentation generatordownload-repo-cli
(by EGOIST)—CLI tool to download GitHub repo.generator-ckeditor4
(by Marek Lewandowski)—Yeoman generator for CKEditor 4generator-clearphp
(by Joschi Kuphal)—Scaffold for Composer based PHP projects with a lot of integrations, advocating the use of The Clear Architecture (https://jkphl.is/articles/clear-architecture-php)generator-nm-bti
(by Tyler Johnson)—Scaffold out a node module, Beneath the Ink style.generator-openapi-repo
(by Roman Hotsiy)—Yeoman generator for OpenAPI(fka Swagger) repo to help you share spec for your APIgit-issues
(by Gabriel Petrovay)—Git issues extension to list issues of a Git projectgit-source
—Parse and stringify git urls in a friendly way.gitbook-start-https-alex-moi
(by Moises Yanes Carballo)—Plugin deploy iaas httpsgitbook-start-iaas-bbdd-alex-moi
(by Moises Yanes Carballo)—Plugin deploy iaas bbddgitbook-start-iaas-ull-es-alex-moi
(by Moises Yanes Carballo)—Plugin deploy maquina iaas-ull-esgitbook-start-iaas-ull-es-merquililycony
(by Constanza León, Merquis Cruz, Liliana Galiano)—El objetivo de esta práctica es extender el package NodeJS publicado en npm en una práctica anterior con una nueva
funcionalidad que permita que los usuarios realizar un despliegue automatico en el servidor de IAASgitbook-start-plugin-iaas-ull-es-noejaco2017
(by alu0100622492)—Despliegue plugin Iaasgithub-publish-npm
(by Ofer Sadgat)—This will upload publish npm assets to the GitHub Releases API.gtni
(by Nur Mohammed Rony)—Install your all npm dependencies recursively with gtni while you are doing git clone, fetch or pullmoto-connector
(by limingv5)—FEB平台SDKnode-coverage-server
(by Gabriel J. Csapo)—A simple lcov server / cli parsernodeschool-admin
(by Martin Heidegger)—CLI tool for setting up and maintaining a nodeschool chapters and other things.ogh
(by EGOIST)—Open GitHub Page of your repo directly in Terminal.pr-log
(by Mathias Schreck)—Changelog generator based on GitHub Pull Requestsproyecto-sytw-alex-moi
(by Moises Yanes Carballo)—Module to build a book on GitBookship-release
—Publish new versions on GitHub and npm with ease.sinit
(by villadora)—Project initializer based on Scaffoldsmart-clone
—Clone a directory into a Golang style directory structuressh-remote
—Automagically switch on the SSH remote url in a Git repository.strapper
(by Sam Newman)—Coming SoonFAQs
A high level git url parser for common git providers.
The npm package git-url-parse receives a total of 1,359,678 weekly downloads. As such, git-url-parse popularity was classified as popular.
We found that git-url-parse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.