git-remotes

1.0.2 • Public • Published

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'
  },
  //...
]

Readme

Keywords

Package Sidebar

Install

npm i git-remotes

Weekly Downloads

36

Version

1.0.2

License

MIT

Last publish

Collaborators

  • digitalsadhu