webcommit

0.1.1 • Public • Published

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));

Package Sidebar

Install

npm i webcommit

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

7.96 kB

Total Files

4

Last publish

Collaborators

  • omihailik