Socket
Socket
Sign inDemoInstall

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


Version published
Maintainers
1
Install size
18.7 kB
Created

Readme

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc