Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
0
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.17.1 to 0.17.2

11

lib/RateLimiterMongo.js

@@ -17,2 +17,3 @@ const RateLimiterStoreAbstract = require('./RateLimiterStoreAbstract');

this.dbName = opts.dbName;
if (opts.mongo) {

@@ -35,2 +36,10 @@ this.client = opts.mongo;

get dbName() {
return this._dbName;
}
set dbName(value) {
this._dbName = typeof value === 'undefined' ? RateLimiterMongo.getDbName() : value;
}
static getDbName() {

@@ -54,3 +63,3 @@ return 'node-rate-limiter-flexible';

if (typeof this.client.db === 'function') {
collection = this.client.db(RateLimiterMongo.getDbName()).collection(this.keyPrefix);
collection = this.client.db(this.dbName).collection(this.keyPrefix);
} else {

@@ -57,0 +66,0 @@ collection = this.client.db.collection(this.keyPrefix);

2

package.json
{
"name": "rate-limiter-flexible",
"version": "0.17.1",
"version": "0.17.2",
"description": "Flexible API rate limiter backed by Redis for distributed node.js applications",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -152,2 +152,7 @@ [![Build Status](https://travis-ci.org/animir/node-rate-limiter-flexible.png)](https://travis-ci.org/animir/node-rate-limiter-flexible)

#### Options specific to Mongo
* `dbName` `Default: 'node-rate-limiter-flexible'` Database where limits are stored. It is created during creating a limiter.
Doesn't work with Mongoose, as mongoose connection is established to exact database.
#### Options specific to Cluster

@@ -154,0 +159,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc