Skip to content

117/throttle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

throttle

version status

A token bucket rate limiter for Deno.

Contents

Features

  • Simple and easy to use.
  • Rate limiting based on token bucket algorithm.

Install

For Deno:

$ deno add @117/throttle

Example

import { createThrottle } from "@117/throttle";

const throttle = createThrottle({ limit: 5, interval: 1000 });

const work = async () => {
    await throttle.wait();
    console.log("request allowed, processing work");
};

setInterval(work, 200);

Contributing

Feel free to contribute and PR to your 💖's content.

About

A token bucket rate limiter for Deno.

Resources

License

Stars

Watchers

Forks