Hub is a cli for github.
I mostly use it for creating pull-requests or to navigate to the github page for the current repository.
It can be used for more, including calling github api’s
Here is an example of fetching a file from a repo (which would work based upon the credentials attached to
hub api -X GET /repos/chriseyre2000/sample-readme/contents/README.md -H "Accept: application/vnd.github.VERSION.raw"
This fetches the content of the file.
Intend to use this to analyse the package.json of a range of projects.
These will be passed into https://github.com/chriseyre2000/package_compare so that I can load a neo4j database. This will allow me to analyse the package dependencies.
Microservices can result in a lot of packages ….
This is a script that can be used to load a node package.json from github into a local neo4j database:
#/bin/bash owner=$1 project=$2 hub api -X GET /repos/$owner/$project/contents/package.json -H "Accept: application/vnd.github.VERSION.raw" > $project.json package_compare $project.json localhost neo4j magicbeans