Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
express-throttle-redis
Advanced tools
Redis wrapper for express-throttle
$ npm install express-throttle-redis
var express = require("express");
var throttle = require("express-throttle");
var redis = require("redis");
var RedisStore = require("express-throttle-redis");
var app = express();
// Rolling window
app.post("/search", throttle({
"burst": 10,
"rate": "5/s",
"store": new RedisStore(redis.createClient())
}), function(req, res, next) {
// ...
})
// Fixed window
app.post("/search", throttle({
"burst": 10,
"period": "1min",
"store": new RedisStore(redis.createClient())
}), function(req, res, next) {
// ...
})
Neither express-throttle
nor express-throttle-redis
will expire / remove / cleanup any keys. This means that memory usage will grow unbounded as new requests are being processed. Thus, it is recommended to have a separate redis instance only for throttling purposes with a sensible maxmemory
setting and maxmemory-policy
set to allkeys-lru
. Furthermore, you may want to disable the persistence layer altogether. Consult the Redis documentation for more information.
FAQs
Redis wrapper for express-throttle
The npm package express-throttle-redis receives a total of 24 weekly downloads. As such, express-throttle-redis popularity was classified as not popular.
We found that express-throttle-redis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.