How to use the @octokit/request.endpoint function in @octokit/request

To help you get started, we’ve selected a few @octokit/request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ZhuPeng / mp-githubtrending / cloud-functions / github / node_modules / @octokit / rest / lib / constructor.js View on Github external
module.exports = Octokit

const endpoint = require('@octokit/request').endpoint
const Hook = require('before-after-hook')

const parseClientOptions = require('./parse-client-options')
const requestWithDefaults = require('./request-with-defaults')

function Octokit (plugins, options) {
  const hook = new Hook()
  const api = {
    hook,
    request: requestWithDefaults(hook, endpoint, parseClientOptions(options))
  }

  plugins.forEach(pluginFunction => pluginFunction(api, options))

  return api
}

@octokit/request

Send parameterized requests to GitHub's APIs with sensible defaults in browsers and Node

MIT
Latest version published 5 months ago

Package Health Score

90 / 100
Full package analysis