package.json 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {
  2. "_args": [
  3. [
  4. "@octokit/plugin-paginate-rest@^1.1.1",
  5. "/mnt/sdc1/Users/James/IdeaProjects/website-core/www/libs/node_modules/@octokit/rest"
  6. ]
  7. ],
  8. "_from": "@octokit/plugin-paginate-rest@>=1.1.1 <2.0.0",
  9. "_hasShrinkwrap": false,
  10. "_id": "@octokit/[email protected]",
  11. "_inCache": true,
  12. "_installable": true,
  13. "_location": "/@octokit/plugin-paginate-rest",
  14. "_nodeVersion": "12.14.1",
  15. "_npmOperationalInternal": {
  16. "host": "s3://npm-registry-packages",
  17. "tmp": "tmp/plugin-paginate-rest_1.1.2_1580605400548_0.8564634561424149"
  18. },
  19. "_npmUser": {
  20. "email": "[email protected]",
  21. "name": "octokitbot"
  22. },
  23. "_npmVersion": "6.13.7",
  24. "_phantomChildren": {},
  25. "_requested": {
  26. "name": "@octokit/plugin-paginate-rest",
  27. "raw": "@octokit/plugin-paginate-rest@^1.1.1",
  28. "rawSpec": "^1.1.1",
  29. "scope": "@octokit",
  30. "spec": ">=1.1.1 <2.0.0",
  31. "type": "range"
  32. },
  33. "_requiredBy": [
  34. "/@octokit/rest"
  35. ],
  36. "_resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz",
  37. "_shasum": "004170acf8c2be535aba26727867d692f7b488fc",
  38. "_shrinkwrap": null,
  39. "_spec": "@octokit/plugin-paginate-rest@^1.1.1",
  40. "_where": "/mnt/sdc1/Users/James/IdeaProjects/website-core/www/libs/node_modules/@octokit/rest",
  41. "bugs": {
  42. "url": "https://github.com/octokit/plugin-paginate-rest.js/issues"
  43. },
  44. "dependencies": {
  45. "@octokit/types": "^2.0.1"
  46. },
  47. "description": "Octokit plugin to paginate REST API endpoint responses",
  48. "devDependencies": {
  49. "@octokit/core": "^2.0.0",
  50. "@pika/pack": "^0.5.0",
  51. "@pika/plugin-build-node": "^0.8.1",
  52. "@pika/plugin-build-web": "^0.8.1",
  53. "@pika/plugin-ts-standard-pkg": "^0.8.1",
  54. "@types/fetch-mock": "^7.3.1",
  55. "@types/jest": "^24.0.18",
  56. "@types/node": "^13.1.0",
  57. "fetch-mock": "^8.0.0",
  58. "jest": "^24.9.0",
  59. "prettier": "^1.18.2",
  60. "semantic-release": "^17.0.0",
  61. "semantic-release-plugin-update-version-in-files": "^1.0.0",
  62. "ts-jest": "^24.1.0",
  63. "typescript": "^3.7.2"
  64. },
  65. "directories": {},
  66. "dist": {
  67. "fileCount": 19,
  68. "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==",
  69. "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNh/ZCRA9TVsSAnZWagAANvUQAI5dCgvRpZGkdfiz0t1E\na69o3gfwQiThi+9wNh9MY69uAXWEhdWBUkle0p4zKFna9NdzLrB2bzrFPRs9\nbdfNbsNu0V7aiOTDLsW4acqEQih9w6A0UO6JRUxw8TdgRtJdnXNXMRL+JJ3J\nzGrzseo+XXW334/CnGdRxOX+5agPtEJronVH7LmO46Tq+RiAfH8KlEjY3idp\nJLMuED8CwhHS+W+Cm4ftINcHz069waHZ92EODzL9aBWpIcfc/fGAmZ+42jtG\nhx2QqBoshCTwYuehBuPxJ0skfMPA84F8rWiAFRbatrVKIc//VKT6NNAqncZH\n9j2jDOYgwePvdRj/ucyyrGOm1lHgSU/oAC/FW5OfuXK2cik1yLGTFhbLn7lX\n0VcHnYYBYSoyNrXRQmKu9qXL4GTeAd4jzhd9ZOTnz9zsgR30FQlwh/7gHp/j\n3QiCps9SP9dYnjRjDZFgEgEr8GY61EyN0merXVI+5QaYHYY09bM560B5Drmx\nUyS9UWfwdxw+U7mY+a00szoyShPF+7Kl+RQGVFUkX6NdfdTxb5gHbByqtDpx\n/w5UrDUHq27fTp+xsU8uAwIv4cGx8mkQPhrh0lNZ5FDA5fjEwbFIsayqVX1Y\nKu3relHHBggZ1wYNfDl9Gr9HJUYLv0EfB/X3bN7Ls4lb0O9t0x41ffePd6fh\nVnmb\r\n=q1Aj\r\n-----END PGP SIGNATURE-----\r\n",
  70. "shasum": "004170acf8c2be535aba26727867d692f7b488fc",
  71. "tarball": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz",
  72. "unpackedSize": 49580
  73. },
  74. "homepage": "https://github.com/octokit/plugin-paginate-rest.js#readme",
  75. "keywords": [
  76. "api",
  77. "github",
  78. "sdk",
  79. "toolkit"
  80. ],
  81. "license": "MIT",
  82. "main": "dist-node/index.js",
  83. "maintainers": [
  84. {
  85. "name": "bkeepers",
  86. "email": "[email protected]"
  87. },
  88. {
  89. "name": "gr2m",
  90. "email": "[email protected]"
  91. },
  92. {
  93. "name": "octokitbot",
  94. "email": "[email protected]"
  95. }
  96. ],
  97. "module": "dist-web/index.js",
  98. "name": "@octokit/plugin-paginate-rest",
  99. "optionalDependencies": {},
  100. "pika": true,
  101. "publishConfig": {
  102. "access": "public"
  103. },
  104. "readme": "# plugin-paginate-rest.js\n\n> Octokit plugin to paginate REST API endpoint responses\n\n[![@latest](https://img.shields.io/npm/v/@octokit/plugin-paginate-rest.svg)](https://www.npmjs.com/package/@octokit/plugin-paginate-rest)\n[![Build Status](https://github.com/octokit/plugin-paginate-rest.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-paginate-rest.js/actions?workflow=Test)\n[![Greenkeeper](https://badges.greenkeeper.io/octokit/plugin-paginate-rest.js.svg)](https://greenkeeper.io/)\n\n## Usage\n\n<table>\n<tbody valign=top align=left>\n<tr><th>\nBrowsers\n</th><td width=100%>\n\nLoad `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev)\n\n```html\n<script type=\"module\">\n import { Octokit } from \"https://cdn.pika.dev/@octokit/core\";\n import { paginateRest } from \"https://cdn.pika.dev/@octokit/plugin-paginate-rest\";\n</script>\n```\n\n</td></tr>\n<tr><th>\nNode\n</th><td>\n\nInstall with `npm install @octokit/core @octokit/plugin-paginate-rest`. Optionally replace `@octokit/core` with a core-compatible module\n\n```js\nconst { Octokit } = require(\"@octokit/core\");\nconst { paginateRest } = require(\"@octokit/plugin-paginate-rest\");\n```\n\n</td></tr>\n</tbody>\n</table>\n\n```js\nconst MyOctokit = Octokit.plugin(paginateRest);\nconst octokit = new MyOctokit({ auth: \"secret123\" });\n\n// See https://developer.github.com/v3/issues/#list-issues-for-a-repository\nconst issues = await octokit.paginate(\"GET /repos/:owner/:repo/issues\", {\n owner: \"octocat\",\n repo: \"hello-world\",\n since: \"2010-10-01\",\n per_page: 100\n});\n```\n\n## `octokit.paginate(route, parameters, mapFunction)` or `octokit.paginate(options, mapFunction)`\n\nThe `paginateRest` plugin adds a new `octokit.paginate()` method which accepts the same parameters as [`octokit.request`](https://github.com/octokit/request.js#request). Only \"List ...\" endpoints such as [List issues for a repository](https://developer.github.com/v3/issues/#list-issues-for-a-repository) are supporting pagination. Their [response includes a Link header](https://developer.github.com/v3/issues/#response-1). For other endpoints, `octokit.paginate()` behaves the same as `octokit.request()`.\n\nThe `per_page` parameter is usually defaulting to `30`, and can be set to up to `100`, which helps retrieving a big amount of data without hitting the rate limits too soon.\n\nAn optional `mapFunction` can be passed to map each page response to a new value, usually an array with only the data you need. This can help to reduce memory usage, as only the relevant data has to be kept in memory until the pagination is complete.\n\n```js\nconst issueTitles = await octokit.paginate(\n \"GET /repos/:owner/:repo/issues\",\n {\n owner: \"octocat\",\n repo: \"hello-world\",\n since: \"2010-10-01\",\n per_page: 100\n },\n response => response.data.map(issue => issue.title)\n);\n```\n\nThe `mapFunction` gets a 2nd argument `done` which can be called to end the pagination early.\n\n```js\nconst issues = await octokit.paginate(\n \"GET /repos/:owner/:repo/issues\",\n {\n owner: \"octocat\",\n repo: \"hello-world\",\n since: \"2010-10-01\",\n per_page: 100\n },\n (response, done) => {\n if (response.data.find(issues => issue.title.includes(\"something\"))) {\n done();\n }\n return response.data;\n }\n);\n```\n\n## `octokit.paginate.iterator(route, parameters)` or `octokit.paginate.iterator(options)`\n\nIf your target runtime environments supports async iterators (such as most modern browsers and Node 10+), you can iterate through each response\n\n```js\nconst parameters = {\n owner: \"octocat\",\n repo: \"hello-world\",\n since: \"2010-10-01\",\n per_page: 100\n }\nfor await (const response of octokit.paginate.iterator(\"GET /repos/:owner/:repo/issues\", parameters)) {\n // do whatever you want with each response, break out of the loop, etc.\n console.log(response.data.title)\n}\n```\n\n## How it works\n\n`octokit.paginate()` wraps `octokit.request()`. As long as a `rel=\"next\"` link value is present in the response's `Link` header, it sends another request for that URL, and so on.\n\nMost of GitHub's paginating REST API endpoints return an array, but there are a few exceptions which return an object with a key that includes the items array.\n\n- [Search repositories](https://developer.github.com/v3/search/#example) (key `items`)\n- [List check runs for a specific ref](https://developer.github.com/v3/checks/runs/#response-3) (key: `check_runs`)\n- [List check suites for a specific ref](https://developer.github.com/v3/checks/suites/#response-1) (key: `check_suites`)\n- [List repositories](https://developer.github.com/v3/apps/installations/#list-repositories) for an installation (key: `repositories`)\n- [List installations for a user](https://developer.github.com/v3/apps/installations/#response-1) (key `installations`)\n\n`octokit.paginate()` is working around these inconsistencies so you don't have to worry about it.\n\nIf a response is lacking the `Link` header, `octokit.paginate()` still resolves with an array, even if the response returns a single object.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## License\n\n[MIT](LICENSE)\n",
  105. "readmeFilename": "README.md",
  106. "repository": {
  107. "type": "git",
  108. "url": "git+https://github.com/octokit/plugin-paginate-rest.js.git"
  109. },
  110. "sideEffects": false,
  111. "source": "dist-src/index.js",
  112. "types": "dist-types/index.d.ts",
  113. "version": "1.1.2"
  114. }