1.0.3 • Published 6 years ago

@shcallaway/git-diff v1.0.3

Weekly downloads
2
License
Unlicense
Repository
-
Last release
6 years ago

Git Diff

Get commits and commit deltas from remote GitHub repos.

Usage

List recent commits:

gitdiff
.getCommits('my_username', 'my_repo')
.then(commits => {});

Or list commits before/after a given ISO 8601 string:

const before = (new Date()).toISOString();
const after = (new Date(1994, 6, 21)).toISOString();

gitdiff
.getCommits('my_username', 'my_repo', { before, after })
.then(commits => {});

Commit objects have the following properties: sha, url and author. Note that, as of this writing, GitHub returns a maximum of 30 commits per request.

Installation

  1. Download: npm install @shcallaway/git-diff --save
  2. Create a personal access token on GitHub.
  3. Require: const GitDiff = require('git-diff')
  4. Instantiate: const gitdiff = new GitDiff(process.env.TOKEN)

Contributing

There is a pre-commit hook that runs the tests. In order for the tests to pass, you must export your GitHub access token as TOKEN.

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago