@colophon/github-client

1.2.0 • Public • Published

@colophon/github-client version License Build Status Downloads

Discover and parse Colophon files in your GitHub repositories.

Install

npm install --save @colophon/github-client

Usage

Use the exposed methods to:

  1. Authenticate your client using getAuthedClient (see options here).
  2. Create a new authorization and retrieve the personal access token using getAuthToken. This token can be stored and then used to simplify consequent requests.
  3. 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

Readme

Keywords

Package Sidebar

Install

npm i @colophon/github-client

Weekly Downloads

0

Version

1.2.0

License

ISC

Unpacked Size

14.3 kB

Total Files

13

Last publish

Collaborators

  • ahmadnassri
  • kspaans
  • ruxandrafed