Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/github-commit-stream
Pull a list of commits from a GitHub repository in via a stream.
https://github.com/hughsk/github-commit-stream
Last synced: 12 days ago
JSON representation
Pull a list of commits from a GitHub repository in via a stream.
- Host: GitHub
- URL: https://github.com/hughsk/github-commit-stream
- Owner: hughsk
- License: other
- Created: 2013-07-12T03:14:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T17:15:10.000Z (about 5 years ago)
- Last Synced: 2024-10-17T16:36:40.163Z (22 days ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 15
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# github-commit-stream #
A streaming interface to pull in a list of commits from a GitHub repository.
If you're looking for something less specific, [github](http://ghub.io/github)
on NPM covers a lot more ground with the GitHub API - but I was running into
a lot of issues with paginating commits so I whipped this up to solve the
problem quickly.## Installation ##
``` bash
npm install github-commit-stream
```## Usage ##
### `exports.createStream(options)` ###
Returns a readable stream that emits commit objects directly from the API.
Takes the following options:
* `user`: The owner of the repository.
* `repo`: The repository name.
* `token`: Your GitHub API token. Optional.
* `per_page`: The amount of commits to retrieve per request. Defaults to 30.
* `since`: Filter to commits since this date.
* `until`: Filter to commits until this date.
* `sha`: SHA or branch to start listing commits from.
* `author`: filter by commit author's login, name or email.``` javascript
var commitStream = require('github-commit-stream')commitStream({
token: process.env.GITHUB_TOKEN
, user: 'substack'
, repo: 'node-browserify'
}).on('data', function(d) {
console.log(d.commit.message)
})
```