@haul/http-client-github
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@haul/http-client-github ·

Install

Using npm:

> npm install @haul/http-client-github

Using yarn:

> yarn add @haul/http-client-github

Usage

import {
  createGithubClient,
} from '@haul/http-client-github';

// Initialize the client
const { client, actions } = createGithubClient(
  process.env.GITHUB_API_TOKEN,
);

;(async async () =>  {
  await actions.issue.createComment('user', 'repo', '49302', `Lorem ipsum dolor sit amet`);

  // You can of course interact with the client directly (note that you lose type-safety)
  await client<null>('/path/to/endpoint', { method: 'DELETE' });
})();

createGithubClient(token: string, fns...) => { client, actions }

Creates a new client. You can pass http-client compatible middleware as rest arguments and they will be passed to the

Readme

Keywords

none

Package Sidebar

Install

npm i @haul/http-client-github

Weekly Downloads

0

Version

0.2.1

License

UNLICENSED

Unpacked Size

31 kB

Total Files

31

Last publish

Collaborators

  • robertstenbom