# node-url-from-git

> parse url from git repo, support github.com and also company specific git repo url

Latest version **1.0.0** (published 2014-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-url-from-git
pnpm add node-url-from-git
yarn add node-url-from-git
bun add node-url-from-git
```

## 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.0 |
| Published | 2014-07-15 |
| First published | 2014-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | TonyAdo |
| Maintainers | tony_ado |
| Keywords | git, url, parser, github, company |

## Links

- npm: https://www.npmjs.com/package/node-url-from-git
- Repository: https://github.com/AdoHe/node-url-from-git
- Issues: https://github.com/AdoHe/node-url-from-git/issues
- npm.io page: https://npm.io/package/node-url-from-git

## 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.0 (latest) — 2014-07-15

## README

# node-url-from-git
![Build Status](https://travis-ci.org/AdoHe/node-url-from-git.svg?branch=master)

```js
describe('index.test.js', function () {
    it('should support git://*', function () {
      var url = 'git://github.com/jamesor/mongoose-versioner';
      parser(url).should.equal('github.com/jamesor/mongoose-versioner');
    });

    it('should support git://*.git', function () {
      var url = 'git://github.com/treygriffith/cellar.git';
      parser(url).should.equal('github.com/treygriffith/cellar');
    });

    it('should support https://*', function () {
      var url = 'https://github.com/Empeeric/i18n-node';
      parser(url).should.equal('github.com/Empeeric/i18n-node');
    });

    it('should parse https://*.git', function () {
      var url = 'https://jpillora@github.com/banchee/tranquil.git';
      parser(url).should.equal('github.com/banchee/tranquil');
    });

    it('should return undefined on failure', function () {
      var url = 'git://github.com/justgord/.git';
      assert(parser(url) == null);
    });

    it('should parse git@gist urls', function () {
      var url = 'git@gist.github.com:3135914.git';
      parser(url).should.equal('gist.github.com/3135914');
    });

    it('should parse https://gist urls', function () {
      var url = 'https://gist.github.com/3135914.git';
      parser(url).should.equal('gist.github.com/3135914');
    });

    it('should parse git@github urls', function () {
      var url = 'git@github.com:AdoHe/ImageServer.git';
      parser(url).should.equal('github.com/AdoHe/ImageServer');
    });

    it('should parse company specific git@* urls', function () {
      var url = 'git@dev.sh.westudio.com:framework/Tunnel.git';
      parser(url).should.equal('dev.sh.westudio.com/framework/Tunnel');
    });
})

describe('re', function () {
    it('should get the url parse regex', function () {
        parser.re.source.should.equal(
            /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?((?:\w+.?){1,}\w+)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source
        )
    });
})
```

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