
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
cov-rate-limit
Advanced tools
A lightweight Rate limiter middleware for Express and Koa. Use to limit repeated requests to public APIs.
$ npm install --save cov-rate-limit
const Koa = require('koa')
const RateLimit = require('cov-rate-limit')
const app = new Koa()
const rateLimiter = RateLimit({
type: 'koa',
max: 100,
duration: 1000 * 60 * 10,
key (ctx) {
return ctx.ip
}
})
app.use(rateLimiter)
RateLimit with redis
const express = require('express')
const RateLimit = require('cov-rate-limit')
const Redis = require('redis')
const redis = Redis.createClient()
const rateLimiter = RateLimit({
type: 'express',
max: 100,
duration: 1000 * 60 * 10, // 10 min
key (req) {
return req.ip
},
cache: redis
})
const app = express()
app.set('trust proxy', 1)
const data = {
data: {
message: '11111111'
},
list: Array.from({ length: 10000 }).map((t, i) => i)
}
app.get('/api1', rateLimiter, (req, res) => {
res.send(data)
})
{
type: 'koa' // 'express'
CacheKey: 'C0V_RATE:',
key (req) {
return req.ip
},
max: 500, // max requests within duration [500]
duration: 1000 * 60 * 15, // of limit in milliseconds [15 * 60 * 1000]
setHeader: true,
cache: redis // redis client [in memory cache]
endSender (req, res) {},
// endSender (ctx, next) {}
}
MIT © Awe
inspiration by express-rate-limit
FAQs
rate-limiting middleware for Express and Koa
The npm package cov-rate-limit receives a total of 4 weekly downloads. As such, cov-rate-limit popularity was classified as not popular.
We found that cov-rate-limit 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.