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

zsecure-express

v1.2.0

Published

Enterprise-grade security layer for Express.js with advanced protection, deception, and threat intelligence

Readme

🛡️ zSecure-Express - Ultimate Security for Node.js

NOTE: I am not an experienced professional developer, and whole of this code is generated by free version of AI.

npm version security License: MIT TypeScript

One-line security for your Express apps. Enterprise-grade protection made simple.

zSecure-Express is a comprehensive security middleware suite designed to protect your Node.js/Express applications against a wide range of cyber threats. It combines industry-standard best practices with advanced features like AI-powered anomaly detection and active deception (honeypots).


✨ Features

| Feature | Description | | --------------------------- | ------------------------------------------------------------------------------- | | 🛡️ Core Protection | Advanced Helmet Headers, CORS, CSRF, and Rate Limiting. | | 🧠 AI Anomaly Detection | Machine learning powered analysis to detect unusual traffic patterns. | | 🍯 Auto Honeypot | Deceptive endpoints (e.g., /wp-admin, /.env) that trap and block attackers. | | 🌍 Threat Intelligence | Real-time IP reputation checks against known banlists (AbuseIPDB, VirusTotal). | | 💉 Injection Prevention | Automatic protection against XSS and SQL Injection attacks. | | 🔌 Plugin System | Extensible architecture with built-in WAF and Audit Log plugins. | | 📜 Zero Config | Works effectively out of the box with smart defaults. |


🚀 Installation

npm install zsecure-express express
# or
yarn add zsecure-express express

⚡ Quick Start

Get full protection in just 5 seconds:

import express from "express";
import { secure } from "zsecure-express";

const app = express();

// 🎉 One line = Full Security
app.use(secure());

app.get("/", (req, res) => {
  res.json({ message: "I am secure!" });
});

app.listen(3000, () => {
  console.log("Server running on port 3000");
});

🎯 Configuration Presets

zSecure comes with optimized presets for common use cases. You don't need to manually configure every option.

import { secure, presets } from "zsecure-express";

// 🏢 Enterprise: Maximum security, strict logging, full threat intel
app.use(secure(presets.enterprise));

// 🔌 API: Optimized for REST/GraphQL (CORS allowed, strict validation)
app.use(secure(presets.api));

// 🛍️ E-commerce: PCI-DSS compliant settings for sensitive transactions
app.use(secure(presets.ecommerce));

// 🍯 Honeypot: Aggressive deception to trap bots
app.use(secure(presets.honeypot));

// 🛠️ Development: Relaxed rules for local testing
app.use(secure(presets.development));

🔧 Custom Configuration

You can override any preset or configure individual modules manually.

app.use(
  secure({
    // Core Modules
    rateLimit: {
      windowMs: 15 * 60 * 1000,
      max: 100,
    },

    // Advanced Modules
    threatIntel: {
      enabled: true,
      providers: ["abuseipdb"],
    },

    // Deception
    honeypot: {
      enabled: true,
      endpoints: ["/admin", "/private"],
    },

    // AI Protection
    anomalyDetection: {
      enabled: true,
      sensitivity: "high",
    },
  })
);

🧩 Modular Usage

If you prefer to use specific middlewares instead of the all-in-one wrapper:

import { helmet, rateLimit, honeywall, xss } from "zsecure-express";

const app = express();

app.use(helmet()); // Secure Headers
app.use(xss()); // XSS Protection
app.use(rateLimit()); // Rate Limiting
app.use(honeywall()); // Honeypot Protection

🛠️ Utilities & Plugins

zSecure includes helpful utilities and a plugin system for extending functionality.

Encryption Helper

import { encryption } from "zsecure-express";

const secret = encryption.encrypt("my-secret-data");
const original = encryption.decrypt(secret);

Enhanced JWT

import { jwt } from "zsecure-express";

const token = await jwt.sign({ userId: 123 });
const payload = await jwt.verify(token);

Plugins

import { secure, SimpleWafPlugin, AuditLogPlugin } from "zsecure-express";

const security = secure();

// Block common malicious patterns
security.use(new SimpleWafPlugin());

// Log all security events
security.use(new AuditLogPlugin({ storage: "file" }));

app.use(security);

📊 Monitoring

Access real-time security insights directly from your app.

import { securityMetrics, honeywall } from "zsecure-express";

// View general security stats
app.get("/admin/security/stats", (req, res) => {
  res.json(securityMetrics.get());
});

// See who fell for the honeypot
app.get("/admin/security/trapped", (req, res) => {
  res.json(honeywall.getInteractions());
});

📄 License

MIT © logien


⚠️ Disclaimer

While zSecure-Express provides extensive security layers, no software offers 100% protection. Always follow security best practices, keep your dependencies updated, and perform regular audits.