webuild-repos
Get a list of open source repositories in your city from Github.
install
npm i webuild-repos
usage
-
we will create the following folder structure:
. ├── .env ├── config.js ├── node_modules │ ├── dotenv │ └── webuild-repos └── index.js
-
create a
.env
file to store all the environment variables:NODE_ENV=staging # put development if you want debug info from GithubLOCATION=Singapore # your city nameMAX_USERS=1000 # query top number of github users from your cityMAX_REPOS=50 # list out top number of repositoriesSTAR_LIMIT=50 # each repo must have at least this number of stars# get from https://github.com/settings/applications/new, refer to https://developer.github.com/v3/oauth/GITHUB_CLIENT_ID=secretGITHUB_CLIENT_SECRET=secret -
create a file
config.js
with the following contents:var city = 'Singapore';var country = 'Singapore';var locationSymbol = 'SG';moduleexports =location: citycity: citycountry: countrysymbol: locationSymbolapi_version: 'v1'debug: processenvNODE_ENV === 'development'githubParams:version: '3.0.0'clientID: processenvGITHUB_CLIENT_IDclientSecret: processenvGITHUB_CLIENT_SECRETlocation: processenvLOCATION || citymaxUsers: processenvMAX_USERS || 1000maxRepos: processenvMAX_REPOS || 50starLimit: processenvSTAR_LIMIT || 50outfile: __dirname + '/cache.json'; -
create
index.js
:;var config = ;var repos = repos;; -
install the relevant dependencies:
npm i webuild-reposnpm i dotenv -
run the file with
node index.js
contribute
Please see CONTRIBUTING.md
for details.
versioning
Following the Semantic Versioning guidelines, run the grunt bump
, grunt bump:minor
or grunt bump:major
commands to bump the version accordingly.
license
webuild-repos is released under the MIT License.