Simple Node script to pull down module READMEs using the GitHub API. Primary use case is for use with Jekyll to include docs from external repositories.
cd get-readmes
npm install
The only dependency is the Node GitHub API; see http://mikedeboer.github.io/node-github.
- Create
repos.json
containing list of repos for which you want to pull down READMEs. A sample is provided. - Create directory, where you want to save the README files. By default, the script
uses
./readmes
directory. To change, set theDIRPATH
variable in the script. The directory must exist before running the script. - To run the script:
node get-readmes [--out=<path-to-output-dir>] [--repos=<path-to-JSON-file>][--debug]
Options:
Option | Description | Default value |
---|---|---|
--out |
Path to directory in which to save README.md files | ./readmes |
--repos |
Path to the JSON file containing list of repos. | ./repos.json |
--debug |
If true, print debug messages | false |
NOTE: This script accesses GitHub APIs without authorization. Since it uses only "read" operations, no authorization is required; however, for unauthenticated requests, GitHub API rate limit is 60 requests per hour. For more information, see https://developer.github.com/v3/#rate-limiting.
Add a way to use OAuth2 tokens to avoid the rate limit. See https://developer.github.com/v3/oauth/