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 🙏

© 2025 – Pkg Stats / Ryan Hefner

recoder-performance

v1.0.0

Published

High-performance monitoring, caching, and optimization utilities for Recoder.xyz

Readme

@recoder/performance

High-performance monitoring, caching, and optimization utilities for Recoder.xyz

Features

  • 🚀 Performance Monitoring - Real-time system metrics, response times, and alerts
  • 🔄 Redis Caching - Production-ready Redis cache with fallback mechanisms
  • 🌐 CDN Management - Asset optimization and edge caching integration
  • 🛡️ Performance Middleware - Comprehensive Express.js middleware stack
  • 📊 Real-time Analytics - Live performance tracking and health monitoring

Installation

npm install @recoder/performance

Quick Start

import { PerformanceManager } from '@recoder/performance';

// Initialize performance manager
const performanceManager = new PerformanceManager({
  redis: { 
    url: 'redis://localhost:6379' 
  },
  monitoring: { 
    interval: 5000, 
    enableAlerts: true 
  }
});

await performanceManager.initialize();

// Get health status
const health = await performanceManager.getHealthStatus();
console.log('System Health:', health);

Individual Components

Performance Monitor

import { PerformanceMonitor } from '@recoder/performance/monitoring';

const monitor = new PerformanceMonitor({
  interval: 5000,
  enableAlerts: true
});

await monitor.start();

// Record request performance
monitor.recordRequest(250); // 250ms response time

// Get metrics
const metrics = monitor.getMetrics();
console.log('Performance:', metrics);

Redis Cache

import { RedisCache } from '@recoder/performance/caching';

const cache = new RedisCache('redis://localhost:6379', {
  defaultTTL: 3600,
  enableFallback: true
});

await cache.connect();

// Cache operations
await cache.set('key', { data: 'value' }, 3600);
const value = await cache.get('key');

Performance Middleware

import express from 'express';
import { middlewareStacks } from '@recoder/performance/middleware';

const app = express();

// Full production middleware stack
app.use(...middlewareStacks.full({
  rateLimiting: { max: 100, windowMs: 15 * 60 * 1000 },
  security: { enableCORS: true, enableHelmet: true }
}));

app.listen(3000);

CDN Manager

import { CDNManager } from '@recoder/performance/cdn';

const cdn = new CDNManager({
  provider: 'cloudflare',
  baseUrl: 'https://cdn.example.com',
  enableCompression: true
});

await cdn.initialize();

// Upload files
const result = await cdn.uploadFile('./dist/app.js');
console.log('CDN URL:', result.url);

Configuration

Environment Variables

# Redis Configuration
REDIS_URL=redis://localhost:6379

# CDN Configuration  
CDN_PROVIDER=cloudflare
CDN_BASE_URL=https://cdn.example.com
CDN_API_KEY=your-api-key

# Monitoring
MONITORING_INTERVAL=5000
ENABLE_ALERTS=true

Features in Detail

Performance Monitoring

  • Real-time CPU, memory, and response time tracking
  • Configurable alerting thresholds
  • Event loop lag detection
  • Error rate monitoring
  • Performance scoring and health status

Redis Caching

  • High-performance Redis integration
  • Automatic fallback to in-memory cache
  • Connection pooling and retry logic
  • Cache statistics and health monitoring
  • Configurable TTL and compression

Middleware Stack

  • Request/response logging
  • Rate limiting with Redis backend
  • Security headers (Helmet functionality)
  • Error handling and monitoring
  • Health check endpoints
  • CORS configuration

CDN Management

  • Multi-provider CDN support (Cloudflare, AWS, etc.)
  • Automatic asset optimization
  • Image resizing and format conversion
  • Cache purging and invalidation
  • Bandwidth and usage analytics

Scripts

# Build the package
npm run build

# Start in production
npm start

# Development with watch mode
npm run dev

# Type checking
npm run typecheck

# Clean build artifacts
npm run clean

License

MIT - Part of the Recoder.xyz ecosystem