@vltpkg/git-scp-url
v0.0.0-0.1730724342581
Published
Parse scp-style git URLs like `git+ssh://host:some/path`
Downloads
196
Keywords
Readme
@vltpkg/git-scp-url
Utility function for parsing git "scp-style" URLs, like git:[email protected]:user/repo
or git+ssh://github.com:user/repo
.
Usage
import { gitScpURL } from '@vltpkg/git-scp-url'
console.log(gitScpURL('[email protected]:user/repo'))
/*
URL {
href: 'git+ssh://[email protected]/user/repo',
// NB: this is only set if the url is http: or https:
origin: 'null',
protocol: 'git+ssh:',
username: 'git',
password: '',
host: 'github.com',
hostname: 'github.com',
port: '',
pathname: '/user/repo',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
*/