Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

onedionys-api-rate-limiting-handler

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onedionys-api-rate-limiting-handler

One Dionys (API Rate Limiting Handler) - Functions to manage rate limiting when interacting with APIs, prevent abuse and ensure service availability.

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to One Dionys - API Rate Limiting Handler! 👋

Functions to manage rate limiting when interacting with APIs, prevent abuse and ensure service availability. 💖

💾 Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax
const RateLimitHandler = require('./src/rateLimitHandler');

// Create a new rate limiter with a limit of 5 requests per minute
const rateLimiter = new RateLimitHandler(5, 60000);

// Handle incoming requests
if (rateLimiter.handleRequest()) {
  // Allow the request to proceed
  console.log('Request allowed');
} else {
  // Block the request
  console.log('Request blocked due to rate limiting');
}
Explanation
  • This package provides a simple rate limiting handler for APIs. The RateLimitHandler class takes two parameters: limit, which specifies the maximum number of requests allowed within the given interval (in milliseconds). The handleRequest method is used to check whether a request should be allowed based on the current rate limit.
Return Value
  • true: If the request is allowed within the rate limit.
  • false: If the request exceeds the rate limit and should be blocked.

📆 Release Date

  • v1.0.0 : 17 March 2024
  • v1.0.1 : 18 March 2024
  • v1.0.2 : 20 March 2024
  • v5.0.0 : 31 March 2024

🧑 Author

  • Facebook : Oned Ionys
  • Instagram : @onedionys
  • Twitter : @onedionys
  • LinkedIn : @onedionys

📝 License

  • Copyright © 2024 One Dionys
  • One Dionys - API Rate Limiting Handler is an open source project licensed under the MIT license

☕️ Suppport & Donation

Love One Dionys - API Rate Limiting Handler? Support this project by donating or sharing with others in need.

Made with ❤️ One Dionys

Keywords

FAQs

Package last updated on 31 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc