0.1.2 • Published 6 years ago

@zcong/redis-ratelimiter v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

redis-ratelimiter

NPM version NPM downloads CircleCI codecov donate

Install

$ yarn add @zcong/redis-ratelimiter

Usage

const Ratelimiter = require('@zcong/redis-ratelimiter')

const rlt = new Ratelimiter({
  redisUrl: process.env.REDIS_URL,
  rate: 2,
  unit: 1
})

const run = async () => {
  const key = 'test_key'
  console.log(await rlt.payload(key)) // false
  console.log(await rlt.payload(key, 2)) // true
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

redis-ratelimiter © zcong1993, Released under the MIT License. Authored and maintained by zcong1993 with help from contributors (list).

github.com/zcong1993 · GitHub @zcong1993

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago