Skip to content
generated from supranim/starter

Supranim's Limiter - A simple to use rate limiting library for HTTP apps to limit any action during a specific period of time.

License

Notifications You must be signed in to change notification settings

supranim/limiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supranim Rate Limiter
A simple to use rate limiting library for web apps.
Provides an easy way to limit any action during a specific period of time.

Key features

  • Simple to use: Easy to integrate into your existing codebase.
import pkg/limiter

# Create a new rate limiter with a limit of 5 requests per minute
var rateLimiter = Limiter(
  maximumHits: 5'u,
  timeLimit: initDuration(seconds = 1),
  timeToWait: initDuration(seconds = 2)
)

# Simulate hits
for i in 0 ..< 5:
  if i < 5:
    assert rateLimiter.hit("127.0.0.1")
  else:
    assert not rateLimiter.hit("127.0.0.1")
sleep(3000)
assert rateLimiter.hit("127.0.0.1")

❤ Contributions & Support

🎩 License

MIT license. Made by Humans from OpenPeeps.
Copyright © 2025 OpenPeeps & Contributors — All rights reserved.

About

Supranim's Limiter - A simple to use rate limiting library for HTTP apps to limit any action during a specific period of time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages