Simple helper to download files from the githubarchive.
Install with npm:
$ npm install --save doowb/download-githubarchive
var downloader = require('download-githubarchive');
Download all of the gzip files from githubarchive.org
const path = require('path');
const downloader = require('download-githubarchive');
const options = {
cwd: path.resolve(__dirname, 'tmp'),
// first day the archive started keeping events
start: '2011-02-12',
// output when each file is being downloaded
callback: (url, fp) => console.log(`${url} => ${path.relative(__dirname, fp)}`),
// organize where the files are saved: 'tmp/YYYY/MM/YYYY-MM-DD-HH.json.gz'
filepath: (name) => `${name.split('-').slice(0, 2).join('/')}/${name}`
};
// run the downloaded (this will take a long time, adjust the start date or add an end date if necessary)
downloader(options)
.then(() => console.log('done'))
.catch(console.error)
.then(() => process.exit());
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Brian Woodward
Copyright © 2018, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on January 31, 2018.