Skip to content
No description or website provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Makefile
README.md
index.js
package.json

README.md

browser support

GitProvider

Build Status

This is library that provides unified high-level interface to different methods of interacting with Git repositories. It suppose to work in browser (via Browserify) and in Node.JS.

Used git adapters:

Planned adapters:

Installation

npm install git-provider

API

Initialization

Github.js

var gitProvider = require("git-provider")
    gp = gitProvider("github",{
        username:"YOUR_GITHUB_USERNAME"
      , password: "YOUR_GITHUB_PASSWORD"
    });

Methods on gp object

gp.authenticatedUserGet(function(err, user){});

gp.reposGet(function(err, repositories){});

gp.repoCreate(repoName, function(err, repo){});

gp.repoDelete(repoName, function(err){});

gp.repoFork = function({url:"git//github.com/darvin/git-provider.git"}, function(err, repo) {});

gp.repoGetContents({
      ref: "master"
    , path: "/path/inside/repo"
  }, function(err, repoContents){});

gp.repoFileGet({
      ref: "master"
    , path: "/path/inside/repo/file.js"
  }, function(err, fileContent, fileSha){});

gp.repoFileUpdate({
      branch: "master"
    , path: "/path/inside/repo/file.js"
    , message: "Commit Message"   //optional
    , content: "New \n file \n content"
  }, function(err){});

gp.repoFileCreate({
      branch: "master"
    , path: "/path/inside/repo/file.js"
    , message: "Commit Message"   //optional
    , content: "New \n file \n content"
  }, function(err){});

gp.repoFileDelete({
      branch: "master"
    , path: "/path/inside/repo/file.js"
    , message: "Commit Message"   //optional
  }, function(err){});
Something went wrong with that request. Please try again.