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

securexpress

v1.0.1

Published

Advanced Express middleware for encryption, performance, DDoS protection and anti-scraping.

Readme

🔐 SecureXpress

SecureXpress adalah middleware all-in-one untuk Express.js yang menggabungkan keamanan, performa, dan kemudahan konfigurasi dalam satu paket. Fitur utama meliputi:

  • Enkripsi request dan response dengan AES-256
  • Proteksi terhadap DDoS dan scraping
  • Optimasi performa dengan kompresi dan caching
  • Deteksi bot dan anomali
  • Manajemen antrean saat lonjakan trafik
  • Dukungan CDN dengan header-aware
  • Konfigurasi mudah hanya dengan satu baris kode

Ideal untuk API modern yang membutuhkan keamanan tinggi dan performa optimal.

📦 Instalasi

npm install securexpress

🚀 Penggunaan Dasar

const express = require('express');
const securexpress = require('securexpress');

const app = express();

app.use(express.text()); // Wajib jika enableEncryption: true

app.use(securexpress({
  secretKey: '12345678901234567890123456789012' // Kunci AES-256 (32 karakter)
}));

app.post('/api', (req, res) => {
  res.send({ message: 'Halo dunia terenkripsi!' });
});

app.listen(3000, () => console.log('Server berjalan di port 3000'));

⚙️ Konfigurasi Lengkap

| Opsi | Tipe | Default | Deskripsi | |-----------------------|---------|---------|-------------------------------------------------------| | secretKey | string | - | Kunci AES-256 (wajib, 32 karakter) | | enableEncryption | boolean | true | Aktifkan enkripsi/dekripsi otomatis | | enableDDoS | boolean | true | Proteksi rate-limiting terhadap DDoS | | enableScrapingGuard | boolean | true | Deteksi bot, scraping, dan header mencurigakan | | enablePerformanceBoost | boolean | true | Aktifkan kompresi dan header caching | | enableTrafficQueue | boolean | true | Antrekan request saat lonjakan trafik | | enableCDNAwareness | boolean | true | Tambahkan header X-Cache-Key untuk CDN | | enablePromoHeader | boolean | true | Tambahkan header X-Powered-By dan promosi package |

🔒 Fitur Enkripsi

  • Menggunakan AES-256-GCM untuk enkripsi request dan response.
  • Request dari client akan didekripsi, response dari server akan dienkripsi otomatis.
  • Jika enableEncryption: false:
    • Gunakan express.json() alih-alih express.text().
    • Request/response dalam format JSON tanpa enkripsi.

🛡️ Proteksi DDoS

  • Berbasis express-rate-limit.
  • Batas default: 100 requests/menit/IP.
  • Dapat dikustomisasi pada versi lanjutan.

🤖 Anti-Scraping

  • Deteksi berdasarkan:
    • User-Agent (contoh: curl, wget, bot).
    • Header tidak lengkap atau abnormal.
  • Mengembalikan status 403 Forbidden jika terdeteksi.

🚀 Optimasi Performa

  • Kompresi dengan gzip atau brotli.
  • Menambahkan header Cache-Control: public, max-age=300.
  • Ideal untuk integrasi dengan CDN atau cache layer.

☁️ Dukungan CDN

  • Menghasilkan header X-Cache-Key berbasis cookie, User-Agent, dan language.
  • Membantu CDN meng-cache response secara granular.

🔄 Manajemen Antrean Trafik

  • Mengantrekan request saat server overload.
  • Default delay: 10ms/request (non-blocking).
  • Cocok untuk lonjakan kecil hingga menengah.
  • Integrasi Redis untuk lonjakan besar (akan datang).

📣 Header Promosi

Default header:

X-Powered-By: securexpress
X-SecureXpress-Promo: Protect your API with https://www.npmjs.com/package/securexpress2

Nonaktifkan dengan enablePromoHeader: false.

📘 Contoh Konfigurasi Lengkap

app.use(securexpress({
  secretKey: '12345678901234567890123456789012',
  enableEncryption: true,
  enableDDoS: true,
  enableScrapingGuard: true,
  enablePerformanceBoost: true,
  enableTrafficQueue: true,
  enableCDNAwareness: true,
  enablePromoHeader: true
}));

👤 Author

Dikembangkan oleh [KANGWIFI]
GitHub: @Yz776
Website: kangwifi

📄 Lisensi

MIT © 2025

❤️ Dukungan

Jika menyukai proyek ini, silakan:

  • 🌟 Beri bintang di GitHub.
  • 🗣️ Bagikan ke komunitas developer.
  • 📦 Install dari NPM dan beri feedback.