1.0.2 • Published 9 years ago

git-remotes v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

git-remotes

NPM Build Status

Fetch git remotes (A nice parsed version of git remote -v).

Runs git remote -v, grabs the result, parses each remote out of it and produces an array of objects out of it.

Installation

npm install git-remotes

Usage

Require module

var gitRemotes = require('git-remotes');

Retrieving git remotes for the current directory

gitRemotes(function (err, remotes) {
  if (err) {
    //do something with the error
  }

  console.log(remotes)
  // -> so long as `err` is null,
  //`remotes` is always an array with 0 or more objects
  // representing git remotes
})

Retrieving git remotes for a specified directory

gitRemotes('./path/to/directory', function (err, remotes) {
  // ...
})

Remote objects

remotes is an array of remote objects that look like:

[
  {
    name: 'origin'
    url: 'git@github.com:digitalsadhu/git-remotes.git'
  },
  //...
]