Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/plugin-throttling

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/plugin-throttling - npm Package Compare versions

Comparing version 2.7.1 to 3.0.0

dist-node/index.js

78

package.json
{
"name": "@octokit/plugin-throttling",
"version": "2.7.1",
"publishConfig": {
"access": "public",
"tag": "latest"
"description": "Octokit plugin for GitHub’s recommended request throttling",
"version": "3.0.0",
"license": "MIT",
"files": [
"dist-*/",
"bin/"
],
"pika": true,
"sideEffects": false,
"homepage": "https://github.com/octokit/plugin-throttling.js#readme",
"bugs": {
"url": "https://github.com/octokit/plugin-throttling.js/issues"
},
"description": "Automatic rate limiting plugin for octokit",
"main": "lib/index.js",
"scripts": {
"coverage": "nyc report --reporter=html && open coverage/index.html",
"pretest": "standard",
"test": "nyc mocha test/integration/",
"update-endpoints": "npm-run-all update-endpoints:*",
"update-endpoints:fetch-json": "node scripts/update-endpoints/fetch-json",
"update-endpoints:code": "node scripts/update-endpoints/code"
},
"repository": {

@@ -22,33 +20,31 @@ "type": "git",

},
"author": "Simon Grondin (http://github.com/SGrondin)",
"license": "MIT",
"bugs": {
"url": "https://github.com/octokit/plugin-throttling.js/issues"
},
"homepage": "https://github.com/octokit/plugin-throttling.js#readme",
"standard": {
"globals": [
"describe",
"before",
"beforeEach",
"afterEach",
"after",
"it",
"expect"
]
},
"dependencies": {
"bottleneck": "^2.15.3"
"bottleneck": "^2.15.3",
"@octokit/types": "^2.0.1"
},
"devDependencies": {
"@octokit/graphql": "^4.2.0",
"@octokit/core": "^2.0.0",
"@octokit/request-error": "^1.0.2",
"@octokit/rest": "^16.3.0",
"chai": "^4.2.0",
"mocha": "^6.0.2",
"npm-run-all": "^4.1.5",
"nyc": "^14.0.0",
"semantic-release": "^15.13.25",
"standard": "^14.0.2"
}
"@pika/pack": "^0.5.0",
"@pika/plugin-build-node": "^0.8.1",
"@pika/plugin-build-web": "^0.8.1",
"@pika/plugin-ts-standard-pkg": "^0.8.1",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^24.0.18",
"@types/node": "^13.1.0",
"fetch-mock": "^8.0.0",
"jest": "^24.9.0",
"prettier": "^1.18.2",
"semantic-release": "^16.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"ts-jest": "^24.1.0",
"typescript": "^3.7.2"
},
"publishConfig": {
"access": "public"
},
"source": "dist-src/index.js",
"types": "dist-types/index.d.ts",
"main": "dist-node/index.js",
"module": "dist-web/index.js"
}

@@ -5,4 +5,4 @@ # plugin-throttling.js

[![npm](https://img.shields.io/npm/v/@octokit/plugin-throttling.svg)](https://www.npmjs.com/package/@octokit/plugin-throttling)
![Build Status](https://github.com/octokit/plugin-throttling.js/workflows/Test/badge.svg)
[![@latest](https://img.shields.io/npm/v/@octokit/plugin-throttling.svg)](https://www.npmjs.com/package/@octokit/plugin-throttling)
[![Build Status](https://github.com/octokit/plugin-throttling.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-throttling.js/actions?workflow=Test)
[![Greenkeeper](https://badges.greenkeeper.io/octokit/plugin-throttling.js.svg)](https://greenkeeper.io/)

@@ -14,2 +14,33 @@

<table>
<tbody valign=top align=left>
<tr><th>
Browsers
</th><td width=100%>
Load `@octokit/plugin-throttling` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev)
```html
<script type="module">
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
import { throttling } from "https://cdn.pika.dev/@octokit/plugin-throttling";
</script>
```
</td></tr>
<tr><th>
Node
</th><td>
Install with `npm install @octokit/core @octokit/plugin-throttling`. Optionally replace `@octokit/core` with a core-compatible module
```js
const { Octokit } = require("@octokit/core");
const { throttling } = require("@octokit/plugin-throttling");
```
</td></tr>
</tbody>
</table>
The code below creates a "Hello, world!" issue on every repository in a given organization. Without the throttling plugin it would send many requests in parallel and would hit rate limits very quickly. But the `@octokit/plugin-throttling` slows down your requests according to the official guidelines, so you don't get blocked before your quota is exhausted.

@@ -20,7 +51,7 @@

```js
const Octokit = require('@octokit/rest')
.plugin(require('@octokit/plugin-throttling'))
const MyOctokit = Octokit.plugin(throttling);
const octokit = new MyOctokit({ auth: "secret123" });
const octokit = new Octokit({
auth: `token ${process.env.TOKEN}`,
const octokit = new MyOctokit({
auth: `secret123`,
throttle: {

@@ -82,3 +113,4 @@ onRateLimit: (retryAfter, options) => {

const octokit = new Octokit({
const octokit = new MyOctokit({
auth: 'secret123'
throttle: {

@@ -85,0 +117,0 @@ onAbuseLimit: (retryAfter, options) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc