A Small Node.js Library to Score HTTP Requests (Privacy-First)
Source: Dev.to
Overview
Bots, scanners, and noisy automated traffic are common in Node.js apps.
Instead of trying to 100 % detect humans, this small open‑source package takes a simpler, more honest approach:
- Scores incoming HTTP requests (0–100) based on risk.
- Lightweight, privacy‑first, and uses transparent heuristics.
- No browser fingerprinting, no external or paid APIs.
- Handles search‑engine crawlers safely.
Package: request-risk-score
Installation
npm install request-risk-score
Usage
const { analyzeRequest } = require('request-risk-score');
const result = analyzeRequest({
ip: '10.0.0.5',
headers: { 'user-agent': 'curl/7.68.0' },
url: '/admin/login'
});
console.log(result);
Example Output
{
"score": 75,
"bucket": "likely_automated",
"signals": ["tool_user_agent", "sensitive_path", "no_cookies"]
}
Why Risk Scoring?
- Blocking decisions remain under your control; the library only provides a probability score and an explanation.
- Works well for small APIs and services that don’t have a Web Application Firewall (WAF).
Links
- npm:
- Blog post: