Get how many requests left
alexmccabe opened this issue · 2 comments
alexmccabe commented
Is there a way to get how many tokens the requesting IP address has left? I can see that it returns the timeLeft, but it would be useful to get the tokens too.
peterkhayes commented
There isn't currently, but I'd be open to a PR if you'd like to. Probably just stick another method on the main rate limiter function.
peterkhayes commented
There is a new version of this library out. You can see the release notes here. It includes this functionality through the limitWithInfo
or wouldLimitWithInfo
methods.