https://github.com/dundalek/github-comparison
Show comparison of github repos in a table with this simple javascript component.
https://github.com/dundalek/github-comparison
Last synced: 30 days ago
JSON representation
Show comparison of github repos in a table with this simple javascript component.
- Host: GitHub
- URL: https://github.com/dundalek/github-comparison
- Owner: dundalek
- Created: 2013-08-17T11:31:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-02-07T19:48:10.000Z (over 5 years ago)
- Last Synced: 2025-04-01T15:56:25.082Z (2 months ago)
- Language: JavaScript
- Size: 2.81 MB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Github Comparison
Show comparison of github repos in a table with this simple javascript component.
See demo at (https://dundalek.com/github-comparison/).
## Usage
Include javascript file into the page (there are no other dependencies):
```html```
```javascript
var repos = ['isaacs/npm', 'https://github.com/bower/bower'];
// simple usage, fetch results and render to an element specified by CSS selector
GithubCompare(repos).render('#selector');// render and return the DOM element
// you can do custom handling
GithubCompare(repos).render(function(el) {
document.body.appendChild(el);
});// you can just get the results without rendering
GithubCompare(repos).json(function(data) {
console.log(data);
});
```You can use [tablesorter plugin](https://github.com/Mottie/tablesorter) to add sorting functionality to the table. Check the source of `index.html` to see how it is done.