jhurliman/node-rate-limiter — pull request #4 by mluto (2013-03-20 18:53:22+00:00)
Title: Added a nicer method to get the number of remaining tokens

This adds the `getTokensRemaining`-method to `RateLimiter`.
An example can be found in the new `README.md`:

```javascript
var RateLimiter = require('limiter').RateLimiter;
var limiter = new RateLimiter(1, 250);

// returns 1 since we did not remove a token and
// our number of tokens per interval is 1
limiter.getTokensRemaining();
```

Getting the number of tokens left was also possible without this method by doing `limiter.tokenBucket.content`, but I think having a special method for this is nicer and cleaner.