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

limitd-client

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limitd-client - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

shard_client.js

14

client.js

@@ -12,7 +12,7 @@ const url = require('url');

const disyuntor = require('disyuntor');
const lps = require('length-prefixed-stream');
const lpm = require('length-prefixed-message');
var defaults = {
const defaults = {
port: 9231,

@@ -23,2 +23,6 @@ host: 'localhost'

function LimitdClient (options, done) {
if (options && options.shard) {
const ShardClient = require('./shard_client');
return new ShardClient(options, done);
}

@@ -84,2 +88,3 @@ EventEmitter.call(this);

} else {
this.host = options.hosts[0];
this._connectUsingReconnect(done);

@@ -265,2 +270,3 @@ }

}
const reset_all = count === 'all';

@@ -272,4 +278,4 @@ const request = {

'method': 'PUT',
'all': count === 'all' ? true : null,
'count': count !== 'all' ? count : null
'all': reset_all ? true : null,
'count': !reset_all ? count : null
};

@@ -276,0 +282,0 @@

{
"name": "limitd-client",
"version": "2.0.2",
"version": "2.1.0",
"description": "limitd client for node.js",

@@ -17,2 +17,3 @@ "main": "index.js",

"lodash": "~3.7.0",
"murmurhash3js": "^3.0.1",
"reconnect-net": "0.0.0",

@@ -24,4 +25,5 @@ "tcp-client-failover": "^1.0.2",

"async": "~2.1.2",
"chai": "~2.2.0",
"mocha": "~2.2.4"
"chai": "^3.5.0",
"mocha": "~2.2.4",
"mockuire": "^1.1.0"
},

@@ -28,0 +30,0 @@ "homepage": "https://github.com/limitd/node-client",

const LimitdClient = require('../');
const MockServer = require('./MockServer');
const assert = require('chai').assert;
const ShardClient = require('../shard_client');

@@ -25,2 +26,7 @@ const _ = require('lodash');

it('should return an instance of ShardClient when initializing with shard', function() {
const client = new LimitdClient({ shard: {hosts: ['limitd://localhost:9231'] }});
assert.instanceOf(client, ShardClient);
});
['take', 'wait'].forEach(function (method) {

@@ -27,0 +33,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