async-ratelimiter
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://nicedoc.io/microlinkhq/async-ratelimiter", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"main": "src/index.js", | ||
@@ -15,32 +15,4 @@ "author": { | ||
{ | ||
"name": "Kiko Beats", | ||
"name": "Kiko", | ||
"email": "josefrancisco.verdu@gmail.com" | ||
}, | ||
{ | ||
"name": "Imed Jaberi", | ||
"email": "imed_jebari@hotmail.fr" | ||
}, | ||
{ | ||
"name": "Marcus Poehls", | ||
"email": "marcus.poehls@gmail.com" | ||
}, | ||
{ | ||
"name": "Ayan Yenbekbay", | ||
"email": "ayan.yenb@gmail.com" | ||
}, | ||
{ | ||
"name": "offirmo", | ||
"email": "offirmo.net@gmail.com" | ||
}, | ||
{ | ||
"name": "Nico Kaiser", | ||
"email": "nico@kaiser.me" | ||
}, | ||
{ | ||
"name": "amanda", | ||
"email": "amandalucis@gmail.com" | ||
}, | ||
{ | ||
"name": "kornel-kedzierski", | ||
"email": "pl.kornel@gmail.com" | ||
} | ||
@@ -66,2 +38,3 @@ ], | ||
"@commitlint/config-conventional": "latest", | ||
"c8": "latest", | ||
"ci-publish": "latest", | ||
@@ -72,6 +45,5 @@ "conventional-github-releaser": "latest", | ||
"ioredis": "latest", | ||
"lint-staged": "latest", | ||
"mocha": "latest", | ||
"nano-staged": "latest", | ||
"npm-check-updates": "latest", | ||
"nyc": "latest", | ||
"prettier-standard": "latest", | ||
@@ -94,6 +66,4 @@ "should": "latest", | ||
"contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"lint": "standard-markdown README.md && standard", | ||
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)", | ||
"precommit": "lint-staged", | ||
"prerelease": "npm run update:check && npm run contributors", | ||
@@ -104,3 +74,3 @@ "pretest": "npm run lint", | ||
"release:tags": "git push --follow-tags origin HEAD:master", | ||
"test": "nyc mocha --exit", | ||
"test": "c8 mocha --exit", | ||
"update": "ncu -u", | ||
@@ -115,6 +85,3 @@ "update:check": "ncu -- --error-level 2" | ||
}, | ||
"lint-staged": { | ||
"package.json": [ | ||
"finepack" | ||
], | ||
"nano-staged": { | ||
"*.js,!*.min.js,": [ | ||
@@ -125,2 +92,5 @@ "prettier-standard" | ||
"standard-markdown" | ||
], | ||
"package.json": [ | ||
"finepack" | ||
] | ||
@@ -130,3 +100,3 @@ }, | ||
"commit-msg": "npx commitlint --edit", | ||
"pre-commit": "npx lint-staged" | ||
"pre-commit": "npx nano-staged" | ||
}, | ||
@@ -133,0 +103,0 @@ "standard": { |
<div align="center"> | ||
<img src="https://cdn.microlink.io/logo/banner.png" alt="microlink"> | ||
<br> | ||
<br> | ||
</div> | ||
@@ -34,3 +36,3 @@ | ||
const clientIp = getClientIp(req) | ||
const limit = await rateLimiter.get({ id: req.clientIp }) | ||
const limit = await rateLimiter.get({ id: clientIp }) | ||
@@ -45,7 +47,8 @@ if (!res.finished && !res.headersSent) { | ||
? sendFail({ | ||
req, | ||
res, | ||
code: HTTPStatus.TOO_MANY_REQUESTS, | ||
message: MESSAGES.RATE_LIMIT_EXCEDEED() | ||
}) : next(req, res) | ||
req, | ||
res, | ||
code: HTTPStatus.TOO_MANY_REQUESTS, | ||
message: MESSAGES.RATE_LIMIT_EXCEDEED() | ||
}) | ||
: next(req, res) | ||
} | ||
@@ -64,3 +67,3 @@ ``` | ||
*Required*<br> | ||
_Required_<br> | ||
Type: `object` | ||
@@ -67,0 +70,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140
9662