package
A lib for parsing the URL of Git Repositories.
npm install parse-git-urlGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
7.3 kB
Includes dependencies.
A lib for parsing the URL of GitHub, GitHub Enterprise Server (ghes), GitLab, and Bitbucket repositories.
import parseGitUrl from 'parse-git-url'
parseGitUrl('https://github.com/vercel/swr')
// => {
// type: 'github',
// owner: 'vercel',
// name: 'swr',
// branch: '',
// sha: '',
// subdir: ''
// }
parseGitUrl('https://github.example.com/vercel/swr', 'github.example.com')
// => {
// type: 'ghes',
// owner: 'vercel',
// name: 'swr',
// branch: '',
// sha: '',
// subdir: ''
// }
parseGitUrl('https://google.com')
// => nullIt supports parsing various URL schemas including SSH, branch, sha, commit, subdirectories, subgroups (GitLab), etc.
vercel-release-bot
infra+release@vercel.com