Commit
Octokat Extension for easy commiting
Installation
npm i octokat @d2k/commit --save
or
yarn add octokat @d2k/commit
Usage
// Require packages
const Octokat = require('octokat')
const Commit = require('commit')
// Create new Instance
const OctokatInstance = new Octokat({ token: YOUR_API_TOKEN })
// Create Commit Object
const newCommit = new Commit({
username: 'your_github_username',
repo: 'your_github_repository',
branch: 'target_branch',
changes: { "file-one.html": "<h1>Hello</h1>", "file-two.html": "<h2>World</h2>" },
message: "My first Commit"
})
// Submit Commit
newCommit.commit()
.then(response => console.log(response))
.catch(err => console.log(err))