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

koa-simple-ratelimit

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-simple-ratelimit - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

13

index.js

@@ -52,4 +52,15 @@ 'use strict';

if (id === false) return next();
if (id === false) {
return next();
}
// whitelist
if (opts.whitelist && opts.whitelist.indexOf(id) !== -1) {
return next();
}
// blacklist
if (opts.blacklist && opts.blacklist.indexOf(id) !== -1) {
return ctx.throw(403);
}
const name = `limit:${id}:count`;

@@ -56,0 +67,0 @@ return find(opts.db, name).then((cur) => {

16

package.json

@@ -5,3 +5,3 @@ {

"repository": "scttcper/koa-simple-ratelimit",
"version": "1.2.0",
"version": "2.0.0",
"keywords": [

@@ -22,10 +22,10 @@ "koa",

"devDependencies": {
"koa": "2.0.0",
"mocha": "^2.5.3",
"koa": "^2.0.0-beta.4",
"mocha": "^3.0.1",
"redis": "^2.6.2",
"should": "^9.0.2",
"eslint": "~3.0.0",
"eslint-config-airbnb-base": "~3.0.1",
"eslint-plugin-import": "~1.10.0",
"supertest": "^1.2.0"
"should": "^10.0.0",
"eslint": "~3.2.2",
"eslint-config-airbnb-base": "~5.0.1",
"eslint-plugin-import": "~1.12.0",
"supertest": "^2.0.0"
},

@@ -32,0 +32,0 @@ "scripts": {

@@ -36,3 +36,5 @@

return ctx.ip;
}
},
blacklist: [],
whitelist: []
}));

@@ -39,0 +41,0 @@

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