@colophon/github-client
v1.2.0
Published
@colophon/github-client
Downloads
5
Keywords
Readme
@colophon/github-client
Discover and parse Colophon files in your GitHub repositories.
Install
npm install --save @colophon/github-client
Usage
Use the exposed methods to:
- Authenticate your client using
getAuthedClient
(see options here). - Create a new authorization and retrieve the personal access token using
getAuthToken
. This token can be stored and then used to simplify consequent requests. - Parse all the repositories in your personal or organization's account and retrieve all info found inside Colophon files using
getColophonData
. If not passing any options, the user's personal repositories will be parsed with the default options (perPage - 100, concurrency - 10).
const { getAuthedClient, getAuthToken, getColophonData } = require('./index.js')
const authedClient = getAuthedClient({ type: 'basic', username: 'username', password: 'password' })
const token = await getAuthToken(authedClient) // not using 2FA OR
const token = await getAuthToken(authedClient, otpCode) // if 2FA is on and using a CLI to get the OTP code from the user
const colophonData = await getColophonData(authedClient, { org: 'acme', perPage: 100, concurrency: 5 })
See more details about Colophon schema here.
License: ISC • Copyright: Colophon Project