Updated all dependencies + Snyk badge to show vulnerabilities

Async version
This commit is contained in:
Romain Prieto 2016-03-29 15:43:37 +11:00
parent 5ac08defb0
commit 3214570b7b
4 changed files with 12 additions and 10 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/node_modules /node_modules
/dump.rdb
.DS_Store .DS_Store

View file

@ -6,6 +6,7 @@
[![Build Status](http://img.shields.io/travis/TabDigital/redis-rate-limiter.svg?style=flat)](http://travis-ci.org/TabDigital/redis-rate-limiter) [![Build Status](http://img.shields.io/travis/TabDigital/redis-rate-limiter.svg?style=flat)](http://travis-ci.org/TabDigital/redis-rate-limiter)
[![Dependencies](http://img.shields.io/david/TabDigital/redis-rate-limiter.svg?style=flat)](https://david-dm.org/TabDigital/redis-rate-limiter) [![Dependencies](http://img.shields.io/david/TabDigital/redis-rate-limiter.svg?style=flat)](https://david-dm.org/TabDigital/redis-rate-limiter)
[![Dev dependencies](http://img.shields.io/david/dev/TabDigital/redis-rate-limiter.svg?style=flat)](https://david-dm.org/TabDigital/redis-rate-limiter) [![Dev dependencies](http://img.shields.io/david/dev/TabDigital/redis-rate-limiter.svg?style=flat)](https://david-dm.org/TabDigital/redis-rate-limiter)
[![Known Vulnerabilities](https://snyk.io/package/npm/redis-rate-limiter/badge.svg)](https://snyk.io/package/npm/redis-rate-limiter)
Rate-limit any operation, backed by Redis. Rate-limit any operation, backed by Redis.

View file

@ -9,16 +9,16 @@
"test": "./node_modules/.bin/mocha" "test": "./node_modules/.bin/mocha"
}, },
"dependencies": { "dependencies": {
"ip": "~0.3.1", "ip": "~1.1.2",
"moment": "~2.8.1" "moment": "~2.12.0"
}, },
"devDependencies": { "devDependencies": {
"async": "~0.9.0", "async": "~1.5.2",
"express": "~4.9.5", "express": "~4.13.4",
"lodash": "~2.4.1", "lodash": "~4.6.1",
"mocha": "~1.21.4", "mocha": "~2.4.5",
"redis": "~0.12.1", "redis": "~2.6.0-0",
"should": "~4.0.4", "should": "~8.3.0",
"supertest": "~0.13.0" "supertest": "~1.2.0"
} }
} }

View file

@ -28,7 +28,7 @@ describe('Rate-limiter', function() {
var limiter = createLimiter('10/second'); var limiter = createLimiter('10/second');
var reqs = request(limiter, 5, {id: 'a'}); var reqs = request(limiter, 5, {id: 'a'});
async.parallel(reqs, function(err, rates) { async.parallel(reqs, function(err, rates) {
_.pluck(rates, 'current').should.eql([1, 2, 3, 4, 5]); _.map(rates, 'current').should.eql([1, 2, 3, 4, 5]);
_.each(rates, function(r) { _.each(rates, function(r) {
r.key.should.eql('a'); r.key.should.eql('a');
r.limit.should.eql(10); r.limit.should.eql(10);