Giter Site home page Giter Site logo

ftl's Introduction

@spacejunk/ftl ๐Ÿš€

๐Ÿšง This project is currently still a work in progress Welcome to @spacejunk/ftl! Having trouble navigating the galaxy of rate limits and bursts while making API requests? FTL (Faster-Than-Light) is here to help. This package is designed to manage and streamline your Axios requests, ensuring they adhere to the rate limits and burst restrictions set by your API provider.

Features:

  • ๐ŸŒŒ Manage rate-limited and burst-limited requests effortlessly
  • ๐Ÿช Automatic request queuing and execution
  • ๐Ÿ›ธ Built-in rate limit and burst tracking
  • ๐Ÿ“ก Exportable request logs for debugging and analysis (๐Ÿšง under development)

Installation

Install @spacejunk/ftl and axios using npm or yarn:

npm install @spacejunk/ftl axios

or

yarn add @spacejunk/ftl axios

Usage

To start using @spacejunk/ftl, follow the example below and customize the configuration to suit your needs. With the provided instance, you can make API requests as you normally would.

import FTL from '@spacejunk/ftl';
import axios from 'axios';

const axiosInstance = axios.create({ baseURL: 'https://api.example.com' });

const ftl = new FTL({
  maxRequestsPerSecond: 10, // the maximum number of requests per second
  burstRequests: 5, // the number of burst requests allowed
  burstTime: 1, // the time window for burst requests (in seconds)
  instance: axiosInstance, // your axios instance
});

const api = ftl.getInstance();

// Now you can make your API requests as usual with your axios instance
api.get('/endpoint').then((response) => {
  console.log(response.data);
});

Contributing

We appreciate all fellow space travelers who want to contribute! If you have any suggestions, bug reports, or feature requests, feel free to open an issue or submit a pull request. Let's make @spacejunk/ftl even better together! ๐Ÿค

ftl's People

Contributors

jonchurch avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.