git-provider
v0.0.0
Published
git-provider ============
Downloads
3
Readme
GitProvider
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:
- node-gitteh Node.js-only libgit2 library
- JS-Git Pure javascript Git implementation
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){});