valeriansaliou / node-fast-ratelimit

:umbrella: Fast and efficient in-memory rate-limit for Node, used to alleviate most common DOS attacks.
https://www.npmjs.com/package/fast-ratelimit
MIT License
107 stars 18 forks source link

Add hasTokenSync and hasToken methods to check without consuming a token #8

Closed RomainLK closed 6 years ago

RomainLK commented 6 years ago

This PR adds 2 methods , sync and async, to check whether a namespace has some remaining token without consuming. This can be used for case like password brute force prevention.

Implements #7

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.04%) to 95.385% when pulling 867397a35634003284272af741ec15ba27e8dfb1 on RomainLK:has-token-methods into bf422ed02245d5d15d10ed830b6eec5578d7cc98 on valeriansaliou:master.

valeriansaliou commented 6 years ago

Thanks 👍

valeriansaliou commented 6 years ago

v2.2.0 released and published on NPM.