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.5 to 2.0.0

dist/cjs/clock.d.ts

0

LICENSE.txt

@@ -0,0 +0,0 @@ Copyright (C) 2011 by John Hurliman

56

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.5",
"description": "A generic rate limiter for the web and node.js. Useful for API clients, web crawling, or other tasks that need to be throttled",
"version": "2.0.0",
"author": "John Hurliman <jhurliman@jhurliman.org>",
"type": "module",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"browser": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"repository": "git://github.com/jhurliman/node-rate-limiter",
"bugs": {
"url": "http://github.com/jhurliman/node-rate-limiter/issues"
},
"license": "MIT",
"files": [
"dist",
"src"
],
"scripts": {
"test": "vows --spec"
"lint": "eslint --fix src",
"prepack": "yarn tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
"test": "jest src"
},
"dependencies": {
"just-performance": "4.2.0"
},
"devDependencies": {
"assert": "1.3.0",
"vows": "0.8.1"
"@babel/core": "^7.13.16",
"@babel/preset-env": "^7.13.15",
"@babel/preset-typescript": "^7.13.0",
"@types/babel__generator": "^7.6.2",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"babel-jest": "^26.6.3",
"eslint": "^7.25.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"typescript": "^4.2.4"
},
"keywords": ["rate", "limiting", "throttling"],
"repository": "git://github.com/jhurliman/node-rate-limiter",
"bugs": { "url": "http://github.com/jhurliman/node-rate-limiter/issues" },
"directories": { "lib": "./lib/" },
"main": "./index.js",
"types": "./index.d.ts",
"licenses": [{
"type": "MIT",
"url": "http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"
}]
"keywords": [
"rate",
"limiting",
"throttling"
]
}

@@ -64,3 +64,3 @@ # limiter #

limiter.removeTokens(1, function(err, remainingRequests) {
if (remainingRequests < 1) {
if (remainingRequests < 0) {
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