Skip to content

Latest commit

 

History

History
121 lines (92 loc) · 3.51 KB

File metadata and controls

121 lines (92 loc) · 3.51 KB

Fuzzbox - Quick Start

✅ Project Status: READY TO PUBLISH

Your production-ready chaos engineering NPM package is complete and built successfully.

📦 What Was Created

Core Files

  • src/ - Full TypeScript source code (9 files)
    • types.ts - All TypeScript interfaces
    • core.ts - Chaos logic, probability calculators, ANSI color logging
    • adapters/express.ts - Express middleware
    • adapters/next.ts - Next.js App Router + Pages Router adapters
    • mutators/ - Body mutation, header havoc, zombie mode
    • dashboard/template.ts - Zero-dependency live HTML dashboard

Build Output (in dist/)

  • index.js - CommonJS build (29.32 KB)
  • index.mjs - ESM build (28.22 KB)
  • index.d.ts - TypeScript definitions (6.12 KB)
  • index.d.mts - TypeScript definitions for ESM

Documentation

  • README.md - Complete user documentation (no AI corporate speak)
  • EXAMPLES.md - Usage examples for Express and Next.js
  • CONTRIBUTING.md - Development setup guide
  • LICENSE - MIT License

Configuration

  • package.json - Ready for NPM publish
  • tsconfig.json - Strict TypeScript configuration
  • .gitignore - Git exclusions
  • .npmignore - NPM publish exclusions

🚀 How to Publish to NPM

1. Set Up Your NPM Account

npm login

2. Update Package Metadata (Optional)

Edit package.json:

  • Change "author" to your name
  • Update "repository" URL if you have a GitHub repo

3. Publish

npm publish

That's it. The package is live on NPM.

🎸 Features Implemented

  1. Latency Injection - Random delays (100ms-3000ms configurable)
  2. Error Fuzzing - Random 500, 502, 503, 504 errors
  3. Timeout Simulation - Infinite request hangs
  4. Body Mutation - Corrupt JSON responses (undefined, -999, flipped booleans)
  5. Zombie Mode - Slow-drip byte streaming
  6. Header Havoc - Scramble/delete/alter response headers
  7. Rate Limiting - Fake 429 responses with Retry-After headers
  8. Live Dashboard - Web UI at /__fuzzbox with real-time controls
  9. Spike Mode - 80% chaos for 30 seconds via dashboard
  10. Route Targeting - Include/exclude specific endpoints
  11. Colorized Logs - ANSI escape codes (no chalk dependency)
  12. Zero Dependencies - Only Node.js built-ins

🧪 Testing Locally Before Publishing

Test with Express

mkdir test-express && cd test-express
npm init -y
npm install express
npm link ../fuzzbox

Create server.js:

const express = require('express');
const { fuzzboxExpress } = require('fuzzbox');

const app = express();
app.use(fuzzboxExpress({ probability: 0.3 }));

app.get('/api/test', (req, res) => {
  res.json({ message: 'Hello World' });
});

app.listen(3000, () => console.log('http://localhost:3000/__fuzzbox'));

Run:

node server.js

Visit http://localhost:3000/__fuzzbox to see the dashboard.

📊 Package Stats

  • Total Size: ~28-29 KB (minified)
  • Dependencies: 0 (zero runtime dependencies)
  • TypeScript: Strict mode, full type safety
  • Build Time: ~2-3 seconds
  • Node Version: >=16.0.0

🔥 Next Steps

  1. Update repository URL in package.json if you have a GitHub repo
  2. Test the package locally using npm link
  3. Publish to NPM with npm publish
  4. Star your own repo (you deserve it)

The package is ready. No changes needed. Ship it.


Built with zero AI corporate speak. Just controlled chaos for resilient systems.