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

express-raw

v1.2.5

Published

Powerful Express.js utility package for better work with Express. Zero dependencies.

Maintainers

ddosnotificationddosnotification

Keywords

expressexpressjsmiddlewareloggingloggerconsoleterminalclidebugdebuggermonitoringanalyticstrackingtrackerbehaviorbehaviouruser-behavioruser-trackingmouse-trackingmouse-movementdevtoolsdeveloper-toolschrome-devtoolsrequest-logginghttp-logginghttp-monitorapi-monitorapi-loggingrest-loggingrest-monitorserver-loggingserver-monitorperformanceperformance-monitoringmetricsstatisticsstatsbot-detectionbot-preventionsecuritymonitoring-tooldevelopment-tooldeveloper-toolsdev-toolscolorful-consolepretty-consolepretty-loggingformatted-loggingconsole-formattingterminal-colorscli-colorsansi-colorszero-dependencylightweightfastefficientminimalsimpleeasynodejsnodetypescripttypescript-supporttypestypingswebwebappweb-appbackendserverserversideexpress-middlewaremiddleware-loggingrequest-monitorresponse-monitorhttp-requesthttp-responseapirestrestfulrestful-apiapi-developmentweb-developmentdevelopmentdebuggingtestingerror-trackingerror-loggingerror-monitoringsystem-monitorsystem-metricsperformance-metricsrequest-metricsresponse-metricsuser-metricsanalytics-toolmonitoring-systemlog-managementlog-monitoringevent-loggingevent-monitoringreal-timereal-time-monitoringreal-time-logginglive-monitoringlive-loggingtraffic-monitortraffic-loggingrequest-trackingresponse-trackinguser-activityactivity-monitoractivity-trackingbehavior-analysisbehaviour-analysisanalysis-tooldiagnosticdiagnostics-tooltroubleshootingdebugging-tooldevelopment-environmentproduction-monitoringstaging-monitoringapplication-monitoringapplication-loggingserver-side-loggingexpress-loggingexpress-monitor

Readme

express-raw

Advanced Express.js Utilities for Modern Applications

npm version downloads GitHub stars

Zero-dependency toolkit for request analytics, performance monitoring, rate limiting, and real-time communication


✨ Features

Core Features

  • 🔍 Request Analytics
  • 🚦 Rate Limiting
  • 📊 Enhanced Logging
  • 👁️ DevTools Detection

Advanced Features

  • 🔌 WebSocket Support
  • 🎯 GraphQL Integration
  • 📈 Metrics Dashboard
  • 🔒 Security Suite

📦 Installation

npm install express-raw
  • Node.js ≥ 14
  • Express.js ≥ 4

🚀 Quick Start

const express = require('express');
const { 
    expressLogger, 
    RateLimiter,
    WebSocketSupport,
    MetricsDashboard 
} = require('express-raw');

const app = express();

// Initialize
const logger = new expressLogger();
const limiter = new RateLimiter({ maxRequests: 100 });
const dashboard = new MetricsDashboard();

// Apply middleware
app.use(limiter.middleware(logger));
app.use(logger.middleware());

// Start server
app.listen(3000, () => logger.serverStart(3000));

📚 Documentation

Rate Limiting

const limiter = new RateLimiter({
    // Time Window
    windowMs: 15 * 60 * 1000,  // 15 minutes
    maxRequests: 100,
    windowType: 'sliding',     // 'sliding' | 'fixed'
    
    // Route Limits
    routeLimits: {
        '/api/auth/.*': 20,    // Auth routes: 20 req/window
        '/api/upload/.*': 10   // Upload routes: 10 req/window
    },
    
    // Security
    autoBan: {
        enabled: true,
        maxViolations: 3,      // Ban after 3 violations
        banDurationMs: 24 * 60 * 60 * 1000 // 24h
    }
});

Enhanced Logging

const logger = new expressLogger({
    enabled: {
        server: true,      // Server logs
        requests: true,    // Request logs
        responses: true,   // Response logs
        websocket: true,   // WebSocket logs
        graphql: true      // GraphQL logs
    }
});

Output Examples

# Server Start
[2024-11-25T19:38:20.177Z] ⚡ [SERVER] Server started
    Port: 3000
    Environment: development
    Memory: 8MB

# Rate Limit Event
[2024-11-25T19:38:26.177Z] ⚠️ [RATELIMIT] Rate limit exceeded
    IP: 192.168.1.100
    Path: /api/users
    ViolationCount: 1

WebSocket Support

const wsSupport = new WebSocketSupport({
    heartbeatInterval: 30000,
    rateLimiting: {
        enabled: true,
        maxConnectionsPerIP: 5
    },
    auth: {
        enabled: true,
        handler: async (req) => {
            // Auth logic
        }
    }
});

// Broadcast
wsSupport.broadcast({ type: 'update', data: { time: Date.now() }});

GraphQL Integration

const profiler = new GraphQLProfiler({
    slowQueryThreshold: 500,    // ms
    maxQueryComplexity: 100,
    maxDepth: 10,
    trackMemory: true
});

app.use('/graphql', profiler.middleware(logger));

Metrics Dashboard

const dashboard = new MetricsDashboard({
    updateInterval: 5000,
    enableRealtime: true,
    alerts: {
        maxMemoryUsage: 85,     // %
        maxErrorRate: 3         // %
    }
});

🎯 Examples

const express = require('express');
const { 
    expressLogger, 
    RateLimiter,
    WebSocketSupport,
    GraphQLProfiler,
    MetricsDashboard
} = require('express-raw');

const app = express();

// Initialize components
const logger = new expressLogger({
    enabled: { 
        rateLimit: true, 
        websocket: true,
        graphql: true 
    }
});

const limiter = new RateLimiter({
    windowMs: 15 * 60 * 1000,
    maxRequests: 100,
    autoBan: { enabled: true }
});

const wsSupport = new WebSocketSupport({
    rateLimiting: { enabled: true }
});

const profiler = new GraphQLProfiler({
    slowQueryThreshold: 500
});

const dashboard = new MetricsDashboard({
    enableRealtime: true
});

// Apply middleware
app.use(limiter.middleware(logger));
app.use(logger.middleware());
app.use('/graphql', profiler.middleware(logger));
app.use(dashboard.middleware(logger, limiter, profiler));

// Start server
const server = app.listen(3000, () => {
    logger.serverStart(3000);
});

wsSupport.middleware(logger)(server);

📋 Best Practices

Rate Limiting

  • Use sliding windows
  • Set route-specific limits
  • Enable auto-ban for security
  • Whitelist trusted IPs

WebSocket

  • Enable heartbeat
  • Implement authentication
  • Set connection limits
  • Handle reconnection

GraphQL

  • Set complexity limits
  • Monitor slow queries
  • Implement depth limiting
  • Cache common queries

Dashboard

  • Set alert thresholds
  • Monitor memory trends
  • Keep reasonable retention
  • Adjust update frequency

🔧 Troubleshooting

Rate Limiter

// Fix: Too many false positives
const limiter = new RateLimiter({
    windowType: 'sliding',
    maxRequests: 200
});

// Fix: Auto-ban too aggressive
const limiter = new RateLimiter({
    autoBan: {
        maxViolations: 5,
        banDurationMs: 60 * 60 * 1000
    }
});

WebSocket

// Fix: Connection drops
const wsSupport = new WebSocketSupport({
    heartbeatInterval: 15000
});

// Fix: Memory leaks
const dashboard = new MetricsDashboard({
    retentionPeriod: 3600000,
    cleanup: true
});

📫 Support

Need help? Found a bug? Have a feature request?


Made with ♥ by ZeX