{"_id":"@aboveyou00/github","_rev":"1-a96765b9cff023630976ca8b19c3361e","name":"@aboveyou00/github","description":"NodeJS wrapper for the GitHub API","dist-tags":{"latest":"12.0.1"},"versions":{"12.0.1":{"name":"@aboveyou00/github","version":"12.0.1","description":"NodeJS wrapper for the GitHub API","author":{"name":"Mike de Boer","email":"info@mikedeboer.nl"},"contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":{"type":"git","url":"git+https://github.com/octokit/node-github.git"},"engines":{"node":">=4"},"dependencies":{"follow-redirects":"1.2.5","https-proxy-agent":"^2.1.0","mime":"^2.0.3","netrc":"^0.1.4"},"devDependencies":{"@octokit/fixtures":"^3.0.0","chai":"^4.1.2","coveralls":"^3.0.0","mocha":"^4.0.1","mustache":"^2.2.1","npm-run-all":"^4.1.1","nyc":"^11.2.1","standard":"^10.0.3","standard-markdown":"^4.0.2","semantic-release":"^8.2.0"},"main":"lib","types":"lib/index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","pretest":"standard && standard-markdown","test":"nyc mocha test/**/*-test.js","build":"npm-run-all build:*","build:flow":"node lib/generateFlowTypes","build:ts":"node lib/generateTypeScriptTypes","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"license":"MIT","licenses":[{"type":"The MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"files":["lib"],"apidoc":{"title":"node-github","name":"node-github","version":"11.0.0","template":{"withCompare":true}},"bugs":{"url":"https://github.com/octokit/node-github/issues"},"homepage":"https://github.com/octokit/node-github#readme","_id":"@aboveyou00/github@12.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"aboveyou00","email":"brandonyoyoslade@gmail.com"},"dist":{"integrity":"sha512-eRMdQUPLfKcVKD/wNYzBVSrPEZwzDFJIN9gpFMdOBZgwh5K8xisuvhLj1aKafynoaR90gbAFfiln0q/Aloh4WA==","shasum":"24f87e85e7a80aa0efaf942f9cdf7f8a3f3e4944","tarball":"https://registry.npmjs.org/@aboveyou00/github/-/github-12.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2+uKOsumGfNU2siZL2SlNSHVfeUom/7OHbfYZh8ulyAIhAOHdksmNXaUMX8QeexekwWbS4dW+HidX7e6Q68foxdd8"}]},"maintainers":[{"name":"aboveyou00","email":"brandonyoyoslade@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/github-12.0.1.tgz_1510424264362_0.7850831386167556"}}},"readme":"# node-github\n\n[![Build Status](https://travis-ci.org/octokit/node-github.svg?branch=master)](https://travis-ci.org/octokit/node-github)\n[![Coverage Status](https://coveralls.io/repos/github/octokit/node-github/badge.svg)](https://coveralls.io/github/octokit/node-github)\n[![Greenkeeper](https://badges.greenkeeper.io/octokit/node-github.svg)](https://greenkeeper.io/)\n[![npm](https://img.shields.io/npm/v/github.svg)](https://www.npmjs.com/package/github)\n\nA Node.js wrapper for GitHub API.\n\n## Installation\n\nInstall via npm.\n\n```bash\nnpm install github\n```\n\nor install via git clone:\n\n```bash\ngit clone https://github.com/octokit/node-github\ncd node-github\nnpm install\n```\n\n## Documentation\n\nClient API: [octokit.github.io/node-github](https://octokit.github.io/node-github/)\nGitHub API: [developer.github.com/v3](https://developer.github.com/v3/)\n\n## Example\n\nGet all followers for user \"defunkt\":\n\n```js\nvar GitHubApi = require('github')\n\nvar github = new GitHubApi({\n    // optional\n  debug: true,\n  Promise: require('bluebird'),\n  timeout: 5000,\n  host: 'github.my-GHE-enabled-company.com', // should be api.github.com for GitHub\n  pathPrefix: '/api/v3', // for some GHEs; none for GitHub\n  protocol: 'https',\n  port: 9898,\n  proxy: '<proxyUrl>',\n  ca: 'whatever',\n  headers: {\n    'accept': 'application/vnd.github.something-custom',\n    'cookie': 'something custom',\n    'user-agent': 'something custom'\n  },\n  requestMedia: 'application/vnd.github.something-custom',\n  followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow disabling follow-redirects\n  rejectUnauthorized: false, // default: true\n  family: 6\n})\n\n// TODO: optional authentication here depending on desired endpoints. See below in README.\n\ngithub.users.getFollowingForUser({\n    // optional\n    // headers: {\n    //     \"cookie\": \"blahblah\"\n    // },\n  username: 'defunkt'\n}, function (err, res) {\n  if (err) throw err\n  console.log(JSON.stringify(res))\n})\n```\n\n## Pagination\n\nThere are a few pagination-related methods:\n\n```\nhasNextPage(link)\nhasPreviousPage(link)\nhasFirstPage(link)\nhasLastPage(link)\n\ngetNextPage(link, headers, callback)\ngetPreviousPage(link, headers, callback)\ngetFirstPage(link, headers, callback)\ngetLastPage(link, headers, callback)\n\nNOTE: link is the response object or the contents of the Link header\n```\n\nSee [here](https://github.com/octokit/node-github/blob/master/examples/paginationCustomHeaders.js) and [here](https://github.com/octokit/node-github/blob/master/examples/getStarred.js) for examples.\n\n## Authentication\n\nMost GitHub API calls don't require authentication. As a rule of thumb: If you can see the information by visiting the site without being logged in, you don't have to be authenticated to retrieve the same information through the API. Of course calls, which change data or read sensitive information have to be authenticated.\n\nYou need the GitHub user name and the API key for authentication. The API key can be found in the user's _Account Settings_.\n\n```javascript\n// basic\ngithub.authenticate({\n  type: 'basic',\n  username: process.env.USERNAME,\n  password: process.env.PASSWORD\n})\n\n// oauth\ngithub.authenticate({\n  type: 'oauth',\n  token: process.env.AUTH_TOKEN\n})\n\n// oauth key/secret (to get a token)\ngithub.authenticate({\n  type: 'oauth',\n  key: process.env.CLIENT_ID,\n  secret: process.env.CLIENT_SECRET\n})\n\n// user token\ngithub.authenticate({\n  type: 'token',\n  token: 'userToken'\n})\n\n// integration (jwt)\ngithub.authenticate({\n  type: 'integration',\n  token: 'jwt'\n})\n\n// ~/.netrc\ngithub.authenticate({\n  type: 'netrc'\n})\n```\n\nNote: `authenticate` is synchronous because it only stores the\ncredentials for the next request.\n\n### Creating a token for your application\n[Create a new authorization](https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization).\n\n1. Use github.authenticate() to authenticate with GitHub using your username / password.\n2. Create an application token programmatically with the scopes you need and, if you use two-factor authentication send the `X-GitHub-OTP` header with the one-time-password you get on your token device.\n\n```javascript\ngithub.authorization.create({\n  scopes: ['user', 'public_repo', 'repo', 'repo:status', 'gist'],\n  note: 'what this auth is for',\n  note_url: 'http://url-to-this-auth-app',\n  headers: {\n    'X-GitHub-OTP': 'two-factor-code'\n  }\n}, function (err, res) {\n  if (err) throw err\n  if (res.token) {\n    // save and use res.token as in the Oauth process above from now on\n  }\n})\n```\n\n## Create test auth file\n\nCreate test auth file for running tests/examples.\n\n```bash\n$ > testAuth.json\n{\n    \"token\": \"<TOKEN>\"\n}\n```\n\n## Promises\n\nFor using bluebird, see [here](https://github.com/octokit/node-github/blob/master/examples/testPromise.js).\nFor using Q, see [here](https://github.com/octokit/node-github/blob/master/examples/testPromiseQ.js).\n\n## Tests\n\nRun all tests\n\n```bash\n$ npm test\n```\n\nOr run a specific test\n\n```bash\n$ npm test test/issuesTest.js\n```\n\n## Preview APIs\n\nAccept headers for the preview APIs should be taken care of behind the scenes, but in the event a preview endpoint isn't working, see [here](https://github.com/octokit/node-github/blob/master/examples/getRawBlob.js) for an example on how to add the required custom accept header.\n\nFor updates on endpoints under preview, see https://developer.github.com/changes/.\n\n| Preview API             | Accept header val                                     |\n| -------------------     | -----------------------------------------------       |\n| Blocking Users          | application/vnd.github.giant-sentry-fist-preview+json |\n| Codes of Conduct        | application/vnd.github.scarlet-witch-preview+json     |\n| Commit Search           | application/vnd.github.cloak-preview+json             |\n| Community               | application/vnd.github.black-panther-preview+json     |\n| Deployment              | application/vnd.github.ant-man-preview+json           |\n| Git signing             | application/vnd.github.cryptographer-preview          |\n| Imports                 | application/vnd.github.barred-rock-preview            |\n| Integrations            | application/vnd.github.machine-man-preview            |\n| License                 | application/vnd.github.drax-preview+json              |\n| Marketplace             | application/vnd.github.valkyrie-preview+json          |\n| Migrations              | application/vnd.github.wyandotte-preview+json         |\n| Nested Teams            | application/vnd.github.hellcat-preview+json           |\n| Pages                   | application/vnd.github.mister-fantastic-preview       |\n| Pre-receive             | application/vnd.github.eye-scream-preview             |\n| Projects                | application/vnd.github.inertia-preview+json           |\n| Pull Request Squash     | application/vnd.github.polaris-preview                |\n| Reactions               | application/vnd.github.squirrel-girl-preview          |\n| Review Requests         | application/vnd.github.thor-preview+json              |\n| Star Creation Timestamp | application/vnd.github.v3.star+json                   |\n| Timeline                | application/vnd.github.mockingbird-preview            |\n| Topics                  | application/vnd.github.mercy-preview+json             |\n\n## Dev notes\n\nTo update the apidoc for github pages:\n\n```bash\n$ npm install apidoc -g\n$ apidoc -i doc/ -o apidoc/\n```\n\nJust a reminder, since an ad-hoc filter was added to the apidoc, don't overwrite index.html, main.js.\n\n## LICENSE\n\nMIT license. See the LICENSE file for details.\n","maintainers":[{"name":"aboveyou00","email":"brandonyoyoslade@gmail.com"}],"time":{"modified":"2022-04-04T11:00:45.159Z","created":"2017-11-11T18:17:44.613Z","12.0.1":"2017-11-11T18:17:44.613Z"},"homepage":"https://github.com/octokit/node-github#readme","repository":{"type":"git","url":"git+https://github.com/octokit/node-github.git"},"contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"author":{"name":"Mike de Boer","email":"info@mikedeboer.nl"},"bugs":{"url":"https://github.com/octokit/node-github/issues"},"license":"MIT","readmeFilename":"README.md"}