1.0.1 • Published 21 days ago

@simple-libs/hosted-git-info v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

@simple-libs/hosted-git-info

ESM-only package NPM version Node version Dependencies status Install size Build status Coverage status

A small library to parse hosted git info.

Install

# pnpm
pnpm add @simple-libs/hosted-git-info
# yarn
yarn add @simple-libs/hosted-git-info
# npm
npm i @simple-libs/hosted-git-info

Usage

import { parseHostedGitUrl } from '@simple-libs/hosted-git-info'

parseHostedGitUrl('github:foo/bar')
/* {
  type: 'github',
  url: 'https://github.com/foo/bar',
  host: 'https://github.com',
  owner: 'foo',
  project: 'bar'
} */
parseHostedGitUrl('git+ssh://bitbucket.org:foo/bar.git')
/* {
  type: 'bitbucket',
  url: 'https://bitbucket.org/foo/bar',
  host: 'https://bitbucket.org',
  owner: 'foo',
  project: 'bar'
} */
parseHostedGitUrl('https://user@gitlab.com/foo/bar.git#branch')
/* {
  type: 'gitlab',
  url: 'https://gitlab.com/foo/bar/tree/branch',
  host: 'https://gitlab.com',
  owner: 'foo',
  project: 'bar'
} */
1.0.1

21 days ago

1.0.0

25 days ago