1.2.2 • Published 6 years ago

github-blob-commit v1.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

github-blob-commit

Single commit for multiple files

githubBlobCommit(options)

Uses Octokat.js

Parameters

parametertypedescription
optionsObjectoptions.owner Github repo owner, options.repo repo name, options.auth (optional) passed through to a new
Octokat instance

Example

var githubBlobCommit = require('github-blob-commit')

var options = {
  owner: 'github_username',
  repo: 'github_repo_name'
  auth: {
    username: "USER_NAME",
    password: "PASSWORD"
    //Or token: "TOKEN"
  }
}

var gh = githubBlobCommit(options)
filesToCommit = [];
fs.readdir("/files/", (err, files) => {
  files.forEach(file => {
    filesToCommit.push({
      path: "/files/"+file,
      content: fs.readFileSync("/files/"+file, "utf8") //optional
    })
  });
  gh.commitFiles(filesToCommit, "github_repo_branch", function(err, data) {
    console.log("Committed");
  })
});

Installation

$ npm install --save github-blob-commit
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago