vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Usage
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/git-scp-url

@vltpkg/git-scp-url

git-scp-url

@vltpkg/git-scp-url

Utility function for parsing git "scp-style" URLs, like git:git@github.com:user/repo or git+ssh://github.com:user/repo.

Usage

JavaScript
import { gitScpURL } from '@vltpkg/git-scp-url'

console.log(gitScpURL('git@github.com:user/repo'))

/*
URL {
  href: 'git+ssh://git@github.com/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: ''
}
*/

PreviousReferenceNextReference

On this page

  • Usage

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now