JSPM

github-api-global

1.0.8
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q11953F
  • License MIT

To create calls to get the data you need by using GitHub REST API

Package Exports

  • github-api-global

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (github-api-global) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GitHub Api's

npm Support Node of LTS dependencies Status

To create calls to get the data you need by using GitHub Rest API

Installation

$ npm install github-api-global

Usage

var githubRequest = require("github-api-global");

GitHub Rest Api Request

// To create calls to get the data you need by using GitHub Rest Api
const options = {
  token: "1e3ed294c3f7tce7btdb743f9135656", // To get token see link below
  method: "get", // As per request
  path: "/repos/{owner}/{repo}/issues", // As per request, owner or user
  body: {
    name: "name",
    description: "description",
    state: "open",
    labels: ["bug", "dev"],
    // Add more body params from GitHub Api docs as per request method describe
  },
};

(async () => {
  console.log(await githubRequest(options)); // returns <response_data>
})();

// More examples of GitHub api request - {}
// GET /user/repos - List repositories for the authenticated user
// POST /user/repos - Create a repository for the authenticated user
// PATCH /repos/{owner}/{repo} - Update a repository
// DELETE /repos/{owner}/{repo} - Delete a repository
// GET /repos/{owner}/{repo}/issues - List repository issues
// POST /repos/{owner}/{repo}/issues - Create an issue
// PATCH /repos/{owner}/{repo}/issues/{issue_number} - Update an issue
// GET /repos/{owner}/{repo}/issues/{issue_number}/comments -Issue comments
// POST /repos/{owner}/{repo}/issues/{issue_number}/comments -Create an comment
// PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} -Update an comment
// ETC as per GitHub REST API docs link below

For more GetHub API method, path and body options flow GitHub Rest Api Docs.

To authenticate with GitHub, set the token option.

License

MIT license.

Copyright © 2021. S.Gupta