npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

@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

Keywords

install

npm i @colophon/github-client

Downloadsweekly downloads

0

version

1.2.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability