npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oxygenlow/webdefender

v0.6.2

Published

Oxygen Low's Software Web Defender: Protect your website or API from DDoS, injection attacks, bots, and malicious traffic.

Downloads

2,079

Readme

@oxygenlow/webdefender

npm version License

Protect your Node.js, Express, Hono, or Next.js applications from DDoS, injection attacks, bots, and malicious traffic with an intelligent, cloud-managed Web Application Firewall (WAF) and middleware by Oxygen Low's Software.

Description

@oxygenlow/webdefender is a robust security middleware package designed by Oxygen Low's Software to safeguard your web applications and APIs. It seamlessly integrates into your existing server architecture to monitor, filter, and optionally block malicious requests in real-time, leveraging the Oxygen Low's Software dashboard for configuration and observability.

Features

  • DDoS Protection: In-memory token bucket rate limiting globally and per-route.
  • Bot Detection: Identify and block malicious bots, ad scrapers, AI assistants, AI scrapers, and data harvesters using user-agent signatures.
  • Injection Scanning: Heuristic detection of SQL injection, shell injection, path traversal, and Server-Side Request Forgery (SSRF) payloads in URL parameters, body, and headers.
  • Geo-IP Blocking: Block requests originating from specific countries.
  • Individual IP Blocking: Block requests originating from specific individual IP addresses.
  • TOR Exit Node Detection: Identify and optionally block traffic coming from known TOR exit nodes.
  • VPN IP Blocking: Identify and block traffic from known VPN providers (VPNBook, NordVPN, Surfshark, ProtonVPN, Mullvad, etc.) to prevent bypassing geo-blocks and IP restrictions.
  • Outbound Connection Monitoring: Track and log outbound HTTP/HTTPS connections made by your application.
  • Auto-Discovery: Automatically discover and sync routes with the central dashboard for Express and Hono apps.

Installation

npm install @oxygenlow/webdefender

Quick Start

Express

import express from 'express';
import { createDefender } from '@oxygenlow/webdefender';

const app = express();
app.use(express.json());

async function start() {
  const { middleware } = await createDefender({
    apiKey: 'your_api_key_here',
  }, app); // Passing 'app' enables auto-route discovery

  app.use(middleware());

  app.get('/', (req, res) => res.send('Hello Secure World!'));
  
  app.listen(3000, () => console.log('Server running securely on port 3000'));
}

start();

Hono

import { Hono } from 'hono';
import { createDefender } from '@oxygenlow/webdefender/hono';

const app = new Hono();

app.use('*', async (c, next) => {
  const middleware = await createDefender({
    apiKey: 'your_api_key_here',
  });
  return middleware(c, next);
});

app.get('/', (c) => c.text('Hello Secure Hono!'));

export default app;

Next.js (Middleware)

// middleware.ts
import { NextResponse } from 'next/server';
import { createNextDefender } from '@oxygenlow/webdefender/next';

const defender = createNextDefender({
  apiKey: 'your_api_key_here'
});

export async function middleware(request) {
  return defender(request, NextResponse);
}

Configuration Options

| Option | Type | Default | Description | |---|---|---|---| | apiKey | string | Required | Your Oxygen Low's Software project API key. | | logOnly | boolean | false | If true, overrides the server config to only log threats, never block. | | syncIntervalMs | number | 60000 | Interval in ms to automatically sync security configuration from the dashboard. Set to 0 to disable. | | onBlocked | function | undefined | Callback fired when a request is blocked locally. | | onError | function | undefined | Callback fired when an internal defender error occurs. |

How it works

When initialized, the middleware fetches its configuration from the central API based on your apiKey. It routinely refreshes known TOR exit nodes and caching IP country codes.

On every incoming request, it executes the following pipeline:

  1. Individual IP Check: Verifies if the request IP is in your blocked IP list.
  2. IP Geo Check: Verifies if the request originates from a blocked country.
  3. TOR Check: Checks if the IP is a known TOR exit node.
  4. VPN Check: Checks if the IP is a known commercial VPN exit node / server.
  5. Known Threat Actor Check: Cross-references with real-time threat intelligence feeds.
  6. Bot Detection: Scans the User-Agent string against known bot signatures.
  7. Injection Scanning: Analyzes the request method, path, query parameters, headers, and body for SQLi, Shell Injection, Path Traversal, and SSRF patterns.
  8. DDoS Protection: Enforces global API rate limits.
  9. Route Rate Limiting: Applies route-specific token-bucket rate limiting based on central configuration.

License

MIT