git-provider

git-provider ============

npm install git-provider
1 downloads in the last day
1 downloads in the last week
5 downloads in the last month

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){});
npm loves you