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

limiter

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limiter - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

index.d.ts

3

package.json
{
"name": "limiter",
"description": "A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled",
"version": "1.1.0",
"version": "1.1.1",
"author": "John Hurliman <jhurliman@jhurliman.org>",

@@ -20,2 +20,3 @@ "scripts": {

"main": "./index.js",
"types": "./index.d.ts",
"licenses": [{

@@ -22,0 +23,0 @@ "type": "MIT",

# limiter #
[![Build Status](https://travis-ci.org/jhurliman/node-rate-limiter.png)](https://travis-ci.org/jhurliman/node-rate-limiter)
[![NPM Downloads](https://img.shields.io/npm/dm/rate-limiter.svg?style=flat)](https://www.npmjs.com/package/limiter)
[![NPM Downloads](https://img.shields.io/npm/dm/limiter.svg?style=flat)](https://www.npmjs.com/package/limiter)

@@ -64,3 +64,3 @@ Provides a generic rate limiter for node.js. Useful for API clients, web

limiter.removeTokens(1, function(err, remainingRequests) {
if (remainingRequests < 0) {
if (remainingRequests < 1) {
response.writeHead(429, {'Content-Type': 'text/plain;charset=UTF-8'});

@@ -67,0 +67,0 @@ response.end('429 Too Many Requests - your IP is being rate limited');

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