Wondering what’s next for npm?Check out our public roadmap! »

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

Keywords

Install

npm i git-remotes

DownloadsWeekly Downloads

6

Version

1.0.2

License

MIT

Last publish

Collaborators

  • avatar