Trent Mick ed154b6fea fix: syntax error in latest with node v4 6 years ago
..
authentication c745f7e01c fix: don’t log same deprecation message twice 6 years ago
endpoint-methods ed154b6fea fix: syntax error in latest with node v4 6 years ago
pagination 347b59d767 refactor: `response.meta` -> `response.headers` 6 years ago
README.md 525b3dca92 docs(plugins): replace `github` with `octokit` in usage example 7 years ago

README.md

@octokit/plugins/*


⚠️ Plugins are currently experimental. APIs can change at any time.


Usage

const octokit = require('@octokit/rest')()

function myPlugin (octokit) {
  octokit.myMethod = function () {
    // ...
  }
  octokit.hook.before('request', (options) => {
    // change options or cancel request.
    // return promise for async methods
  })
  octokit.hook.after('request', (result, options) => {
    // ...
  })
}

octokit.plugin(myPlugin)

octokit.myMethod()
octokit.request({url: '/'}) // runs before/after hooks defined above