Socket
Book a DemoInstallSign in
Socket

parse-repo

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-repo

Extract repository info from a git remote URI

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
63K
2.9%
Maintainers
1
Weekly downloads
 
Created
Source

parse-repo

Extract repository information from a git remote URI.

Installation

npm install parse-repo

Usage

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

Keywords

parse

FAQs

Package last updated on 03 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts