# parse-repo

> Extract repository info from a git remote URI

Latest version **1.0.4** (published 2017-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-repo
pnpm add parse-repo
yarn add parse-repo
bun add parse-repo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-11-03 |
| First published | 2016-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Diego Guerra |
| Maintainers | dgoguerra |
| Keywords | parse, repository, repo, uri, github, bitbucket |

## Links

- npm: https://www.npmjs.com/package/parse-repo
- Repository: https://github.com/dgoguerra/parse-repo
- Issues: https://github.com/dgoguerra/parse-repo/issues
- npm.io page: https://npm.io/package/parse-repo

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-11-03
- 1.0.3 — 2017-10-17
- 1.0.2 — 2017-10-17
- 1.0.1 — 2016-03-21
- 1.0.0 — 2016-03-21

## README

parse-repo
==========

Extract repository information from a git remote URI.

Installation
------------

```
npm install parse-repo
```

Usage
-----

```js
var parseRepo = require('parse-repo');

// parsing a GitHub https remote
parseRepo('https://github.com/npm/docs.git');
/*
{ remote: 'https://github.com/npm/docs.git',
  protocol: 'https',
  host: 'github.com',
  repository: 'npm/docs',
  owner: 'npm',
  project: 'docs' }
*/

// slightly different bitbucket URI
parseRepo('https://user@bitbucket.org/owner/org');
/*
{ remote: 'https://user@bitbucket.org/owner/org',
  protocol: 'https',
  host: 'bitbucket.org',
  repository: 'owner/org',
  owner: 'owner',
  project: 'org' }
*/

// git remotes are also supported
parseRepo('git@gitlab.com:gitlab-org/gitlab-ce.git');
/*
{ remote: 'git@gitlab.com:gitlab-org/gitlab-ce.git',
  protocol: 'git',
  host: 'gitlab.com',
  repository: 'gitlab-org/gitlab-ce',
  owner: 'gitlab-org',
  project: 'gitlab-ce' }
*/

// a local remote, without owner information
parseRepo('/local/path/repo-name');
/*
{ remote: '/local/path/repo-name',
  protocol: 'file',
  host: 'localhost',
  repository: 'repo-name',
  owner: null,
  project: 'repo-name' }
*/
```

License
-------
MIT license - http://www.opensource.org/licenses/mit-license.php

---
_Source: https://npm.io/package/parse-repo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
