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

rate-limiter-promise

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

rate-limiter-promise

A wrapper to limit functions in promises

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rate-limiter-promise

A simple library to wrap methods with rate limiting.

npm version Test

Instalation

To install simply run:

$ npm install rate-limiter-promise

Or, if you use yarn:

$ yarn add rate-limiter-promise

Example usage

const limiter = require('rate-limiter-promise');
const fn = a => a*a;
const limitedFn = limiter(fn).to(1).per(1000);

const a = await limitedFn(2);

Test

To test, simply run:

$ npm test

You can also check for linting errors:

$ npm run lint

License

Unlicense

Keywords

FAQs

Package last updated on 03 Feb 2022

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