How to use the rate-limiter-flexible.RateLimiterMemory.prototype function in rate-limiter-flexible

To help you get started, we’ve selected a few rate-limiter-flexible examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ravangen / graphql-rate-limit / src / __tests__ / index.spec.ts View on Github external
describe('createRateLimitDirective', () => {
  const consume = jest.spyOn(RateLimiterMemory.prototype, 'consume');
  const resolvers = {
    Query: {
      books: () => [
          title: 'A Game of Thrones',
          author: 'George R. R. Martin',
          title: 'The Hobbit',
          author: 'J. R. R. Tolkien',
      quote: () =>
        'The future is something which everyone reaches at the rate of sixty minutes an hour, whatever he does, whoever he is. ― C.S. Lewis',


Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM

Latest version published 3 months ago

Package Health Score

82 / 100
Full package analysis