New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@upstash/ratelimit

Package Overview
Dependencies
Maintainers
5
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@upstash/ratelimit - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0-canary.0

./dist/index.js

65

package.json
{
"module": "./esm/mod.js",
"main": "./script/mod.js",
"types": "./types/mod.d.ts",
"name": "@upstash/ratelimit",
"version": "v0.2.0",
"description": "A serverless ratelimiter built on top of Upstash REST API.",
"repository": {
"type": "git",
"url": "git+https://github.com/upstash/ratelimit.git"
},
"version": "0.3.0-canary.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
"private": false,
"keywords": [

@@ -20,4 +16,2 @@ "rate",

],
"author": "Andreas Thomas <andreas.thomas@chronark.com>",
"license": "MIT",
"bugs": {

@@ -27,35 +21,22 @@ "url": "https://github.com/upstash/ratelimit/issues"

"homepage": "https://github.com/upstash/ratelimit#readme",
"files": [
"./dist/**"
],
"author": "Andreas Thomas <andreas@upstash.com>",
"devDependencies": {
"@size-limit/preset-small-lib": "latest",
"@upstash/redis": "1.3.3-alpha.1",
"size-limit": "latest"
"@jest/globals": "^29.3.1",
"@types/jest": "^29.2.5",
"@types/node": "^18.11.18",
"@upstash/redis": "^1.19.3",
"dotenv-cli": "^7.0.0",
"jest": "^29.3.1",
"ts-jest": "^29.0.3",
"tsup": "^6.2.3",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
},
"peerDependencies": {
"@upstash/redis": "^1.4.0"
},
"size-limit": [
{
"path": "esm/mod.js",
"limit": "15 KB"
},
{
"path": "script/mod.js",
"limit": "15 KB"
}
],
"exports": {
".": {
"import": {
"types": "./types/mod.d.ts",
"default": "./esm/mod.js"
},
"require": {
"types": "./types/mod.d.ts",
"default": "./script/mod.js"
}
}
},
"dependencies": {
"@deno/shim-crypto": "~0.3.1"
"scripts": {
"build": "tsup",
"test": "dotenv -e ../../.env jest"
}
}
}

@@ -153,2 +153,16 @@ # Upstash RateLimit

### Timeout
You can define an optional timeout in milliseconds, after which the request will
be allowed to pass regardless of what the current limit is. This can be useful
if you don't want network issues to cause your application to reject requests.
```ts
const ratelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.slidingWindow(10, "10 s"),
timeout: 1000, // 1 second
});
```
### Block until ready

@@ -155,0 +169,0 @@

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