Convenience wrapper for Got to interact with the GitHub API. Current stable version is 12.0.0 (requires Node.js 22). Release cadence is irregular with major versions often tied to Got updates. Key differentiators: automatic token handling via GITHUB_TOKEN env var, built-in rate limit info on responses/errors, supports GitHub Enterprise via prefixUrl. Pure ESM since v10, uses Got 15 internally. Consider @octokit/rest.js or @octokit/graphql.js unless already using Got.
npm install gh-gotVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: import default, authenticate via token context, handle response and rate limit info.
Use import syntax instead of require(); update Node.js to >=14 (v12 requires Node.js 22).
Remove leading slash: use 'users' instead of '/users'.
Replace 'endpoint' with 'baseUrl' in options.
Upgrade Node.js to >=22.
Consider migrating to official GitHub SDKs for better features and support.
Set token via context.token or GITHUB_TOKEN env var. Use options.headers.authorization for non-token auth (e.g., Bearer JWT).
Use import statement instead of require(), or update Node.js to >=14 and use dynamic import.
Ensure prefixUrl ends with trailing slash, e.g., 'https://api.github.com/'.
Set GITHUB_TOKEN environment variable or pass token in options.context.token.