Socket
Socket
Sign inDemoInstall

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 2.0.0 to 2.1.0

7

index.js

@@ -67,7 +67,6 @@ 'use strict';

return find(opts.db, name).then((cur) => {
const n = ~~cur;
const ex = opts.duration || 3600000;
const n = Math.floor(cur);
let t = Date.now();
t += ex;
t = new Date(t).getTime() / 1000 | 0;
t += opts.duration || 3600000;
t = new Date(t).getTime() / 1000 || 0;

@@ -74,0 +73,0 @@ const headers = {};

{
"name": "koa-simple-ratelimit",
"description": "Simple Rate limiter middleware for koa",
"repository": "scttcper/koa-simple-ratelimit",
"version": "2.0.0",
"description": "Simple Rate limiter middleware for koa v2",
"repository": {
"type": "git",
"url": "git+https://github.com/scttcper/koa-simple-ratelimit.git"
},
"version": "2.1.0",
"keywords": [

@@ -21,9 +24,9 @@ "koa",

"devDependencies": {
"koa": "^2.0.0-beta.4",
"mocha": "^3.0.1",
"koa": "2.0.0-alpha.7",
"mocha": "^3.0.2",
"redis": "^2.6.2",
"should": "^10.0.0",
"eslint": "~3.2.2",
"eslint-config-airbnb-base": "~5.0.1",
"eslint-plugin-import": "~1.12.0",
"should": "^11.1.0",
"eslint": "~3.6.0",
"eslint-config-airbnb-base": "~8.0.0",
"eslint-plugin-import": "~1.16.0",
"supertest": "^2.0.0"

@@ -30,0 +33,0 @@ },

@@ -57,2 +57,4 @@

- `id` id to compare requests [ip]
- `whitelist` array of ids to whitelist
- `blacklist` array of ids to blacklist

@@ -59,0 +61,0 @@ ## Responses

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