0.1.1 • Published 4 months ago
webcommit v0.1.1
webcommit
Self-contained library to commit into GitHub.
Author: Oleg Mihailik @oyin.bo.
Using with no dependencies:
const prepare = await webcommit({
owner: 'oyin-bo',
repo: 'webcommit',
branch: 'test',
auth: prompt('GITHUB AUTH')
});
await prepare.put(
'test.txt',
'No dependencies: ' + new Date()
);
const commit = await prepare.commit('Committing with no dependencies at all');
alert('Committed \n' + JSON.stringify(commit, null, 2));
With Octokit:
const octokit = new Octokit({ auth: prompt('GITHUB AUTH') });
const prepare = await webcommit({
owner: 'oyin-bo',
repo: 'webcommit',
branch: 'test',
octokit // <-- here
});
await prepare.put(
'test.txt',
'Using Octokit: ' + new Date()
);
const commit = await prepare.commit('Using Octokit');
alert('Committed \n' + JSON.stringify(commit, null, 2));