{"_id":"@akshatv21/chaosproxy","_rev":"4-f371076d9847e6bfec31abb8f434a265","name":"@akshatv21/chaosproxy","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@akshatv21/chaosproxy","version":"1.0.0","keywords":["cli","proxy","chaos-engineering","testing","developer-tools","mocking","network"],"author":{"url":"https://vishwakarma.pro","name":"Akshat Vishwakarma","email":"a.vishwakarma1021@gmail.com"},"license":"MIT","_id":"@akshatv21/chaosproxy@1.0.0","maintainers":[{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"}],"homepage":"https://github.com/akshatV21/chaos-proxy#readme","bugs":{"url":"https://github.com/akshatV21/chaos-proxy/issues"},"bin":{"chaos":"dist/main.js"},"dist":{"shasum":"f70ec46ffb68d39fd99f8081c069fbf605fad3f7","tarball":"https://registry.npmjs.org/@akshatv21/chaosproxy/-/chaosproxy-1.0.0.tgz","fileCount":34,"integrity":"sha512-BxJen+PjTy8UfkwhwrtmkEBVgyoAXC5ma4yc+TcSSGdmaxenBHCjbnK6vpZKTMNEFkmwM/Y3bCM3lmZK8ITZTA==","signatures":[{"sig":"MEUCIQDGxB/dNELMMKPY1RA0jSKZ4zpT+vust9kbNwPFNic/BgIgFlhYF44jtbH9cmrPoKXuS2obdwJBzmLzSzVwJAdDGAE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242179},"engines":{"node":">=18.0.0"},"gitHead":"15049b2dbd687715bed5d14952cd410401340ddc","private":false,"scripts":{"build":"nest build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"},"repository":{"url":"git+https://github.com/akshatV21/chaos-proxy.git","type":"git"},"_npmVersion":"11.6.4","description":"The localhost saboteur. Test your UI's resilience by breaking your API on purpose.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"^4.3.6","rxjs":"^7.8.1","boxen":"^8.0.1","chalk":"^4.1.2","fs-extra":"^11.3.4","cli-table3":"^0.6.5","http-proxy":"^1.18.1","@nestjs/core":"^11.0.1","@nestjs/common":"^11.0.1","nest-commander":"^3.20.1","path-to-regexp":"^8.4.2","reflect-metadata":"^0.2.2","@nestjs/platform-express":"^11.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.18.0","globals":"^16.0.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","@swc/cli":"^0.6.0","prettier":"^3.4.2","@swc/core":"^1.10.7","supertest":"^7.0.0","ts-loader":"^9.5.2","@eslint/js":"^9.18.0","typescript":"^5.7.3","@nestjs/cli":"^11.0.0","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/express":"^5.0.0","tsconfig-paths":"^4.2.0","@nestjs/testing":"^11.0.1","@types/fs-extra":"^11.0.4","@eslint/eslintrc":"^3.2.0","@types/supertest":"^6.0.2","@types/http-proxy":"^1.17.17","typescript-eslint":"^8.20.0","@nestjs/schematics":"^11.0.0","source-map-support":"^0.5.21","@types/path-to-regexp":"^1.0.29","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/chaosproxy_1.0.0_1776071477453_0.33931100768058253","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@akshatv21/chaosproxy","version":"1.0.1","keywords":["cli","proxy","chaos-engineering","testing","developer-tools","mocking","network"],"author":{"url":"https://vishwakarma.pro","name":"Akshat Vishwakarma","email":"a.vishwakarma1021@gmail.com"},"license":"MIT","_id":"@akshatv21/chaosproxy@1.0.1","maintainers":[{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"}],"homepage":"https://github.com/akshatV21/chaos-proxy#readme","bugs":{"url":"https://github.com/akshatV21/chaos-proxy/issues"},"bin":{"chaos":"dist/main.js"},"dist":{"shasum":"bf3c2ead38aeb9dfc0ecf3828bf2083c82c6fc5a","tarball":"https://registry.npmjs.org/@akshatv21/chaosproxy/-/chaosproxy-1.0.1.tgz","fileCount":34,"integrity":"sha512-ykC4NPbdrdceFJcTgQsvMQytqQ/cbMZUUcHdMIlMuyL0lnbEhGFQBtzr8lQ+6fyjI+ZAFtmTbdHMADJWyG4BAg==","signatures":[{"sig":"MEUCICRDhuwBIok6jtCCiMP+pXvpWBfb4JWdni9maduUXOsDAiEAnkyPHxgvOHJKrowx+9NASmubr+hJ+RQuW687AvcyVT0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242187},"engines":{"node":">=18.0.0"},"gitHead":"14b9864a39fd525c63db8467d81f8e075ff107a3","private":false,"scripts":{"build":"nest build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"},"repository":{"url":"git+https://github.com/akshatV21/chaos-proxy.git","type":"git"},"_npmVersion":"11.6.4","description":"The localhost saboteur. Test your UI's resilience by breaking your API on purpose.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"^4.3.6","rxjs":"^7.8.1","boxen":"^8.0.1","chalk":"^4.1.2","fs-extra":"^11.3.4","cli-table3":"^0.6.5","http-proxy":"^1.18.1","@nestjs/core":"^11.0.1","@nestjs/common":"^11.0.1","nest-commander":"^3.20.1","path-to-regexp":"^8.4.2","reflect-metadata":"^0.2.2","@nestjs/platform-express":"^11.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.18.0","globals":"^16.0.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","@swc/cli":"^0.6.0","prettier":"^3.4.2","@swc/core":"^1.10.7","supertest":"^7.0.0","ts-loader":"^9.5.2","@eslint/js":"^9.18.0","typescript":"^5.7.3","@nestjs/cli":"^11.0.0","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/express":"^5.0.0","tsconfig-paths":"^4.2.0","@nestjs/testing":"^11.0.1","@types/fs-extra":"^11.0.4","@eslint/eslintrc":"^3.2.0","@types/supertest":"^6.0.2","@types/http-proxy":"^1.17.17","typescript-eslint":"^8.20.0","@nestjs/schematics":"^11.0.0","source-map-support":"^0.5.21","@types/path-to-regexp":"^1.0.29","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/chaosproxy_1.0.1_1776071885666_0.11349201597044845","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@akshatv21/chaosproxy","version":"1.0.2","keywords":["cli","proxy","chaos-engineering","testing","developer-tools","mocking","network"],"author":{"url":"https://vishwakarma.pro","name":"Akshat Vishwakarma","email":"a.vishwakarma1021@gmail.com"},"license":"MIT","_id":"@akshatv21/chaosproxy@1.0.2","maintainers":[{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"}],"homepage":"https://github.com/akshatV21/chaos-proxy#readme","bugs":{"url":"https://github.com/akshatV21/chaos-proxy/issues"},"bin":{"chaos":"dist/main.js"},"dist":{"shasum":"40517ee41ca18d278e609d48adc8642b56c46e5d","tarball":"https://registry.npmjs.org/@akshatv21/chaosproxy/-/chaosproxy-1.0.2.tgz","fileCount":34,"integrity":"sha512-H1H8SVXrTpMSjmqEH0c/sRdrpUJEs2Aat7QKDKk8nrPl+yXxpBYuHqGR7QqFLjqV7rNy/pf97Aap0fD2OZVRxQ==","signatures":[{"sig":"MEYCIQCFKbeYeHU7jLesv+9kOn4AB52/+HaXFGztjy7R14n0iQIhAJvRY+rUGIaGosAiurXBQy1L5ww/GnKKAwpnFSSopy8I","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242066},"engines":{"node":">=18.0.0"},"gitHead":"14b9864a39fd525c63db8467d81f8e075ff107a3","private":false,"scripts":{"build":"nest build","prepublishOnly":"npm run build"},"_npmUser":{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"},"repository":{"url":"git+https://github.com/akshatV21/chaos-proxy.git","type":"git"},"_npmVersion":"11.6.4","description":"The localhost saboteur. Test your UI's resilience by breaking your API on purpose.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"^4.3.6","rxjs":"^7.8.1","boxen":"^8.0.1","chalk":"^4.1.2","fs-extra":"^11.3.4","cli-table3":"^0.6.5","http-proxy":"^1.18.1","@nestjs/core":"^11.0.1","@nestjs/common":"^11.0.1","nest-commander":"^3.20.1","path-to-regexp":"^8.4.2","reflect-metadata":"^0.2.2","@nestjs/platform-express":"^11.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.18.0","globals":"^16.0.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","@swc/cli":"^0.6.0","prettier":"^3.4.2","@swc/core":"^1.10.7","supertest":"^7.0.0","ts-loader":"^9.5.2","@eslint/js":"^9.18.0","typescript":"^5.7.3","@nestjs/cli":"^11.0.0","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/express":"^5.0.0","tsconfig-paths":"^4.2.0","@nestjs/testing":"^11.0.1","@types/fs-extra":"^11.0.4","@eslint/eslintrc":"^3.2.0","@types/supertest":"^6.0.2","@types/http-proxy":"^1.17.17","typescript-eslint":"^8.20.0","@nestjs/schematics":"^11.0.0","source-map-support":"^0.5.21","@types/path-to-regexp":"^1.0.29","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/chaosproxy_1.0.2_1776072081773_0.33392430726389155","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@akshatv21/chaosproxy","version":"1.0.3","description":"The localhost saboteur. Test your UI's resilience by breaking your API on purpose.","author":{"name":"Akshat Vishwakarma","email":"a.vishwakarma1021@gmail.com","url":"https://vishwakarma.pro"},"private":false,"bin":{"chaos":"dist/main.js"},"license":"MIT","scripts":{"build":"nest build","prepublishOnly":"npm run build"},"keywords":["cli","proxy","chaos-engineering","testing","developer-tools","mocking","network"],"dependencies":{"@nestjs/common":"^11.0.1","@nestjs/core":"^11.0.1","@nestjs/platform-express":"^11.0.1","boxen":"^8.0.1","chalk":"^4.1.2","cli-table3":"^0.6.5","fs-extra":"^11.3.4","http-proxy":"^1.18.1","nest-commander":"^3.20.1","path-to-regexp":"^8.4.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.1","zod":"^4.3.6"},"devDependencies":{"@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.18.0","@nestjs/cli":"^11.0.0","@nestjs/schematics":"^11.0.0","@nestjs/testing":"^11.0.1","@swc/cli":"^0.6.0","@swc/core":"^1.10.7","@types/express":"^5.0.0","@types/fs-extra":"^11.0.4","@types/http-proxy":"^1.17.17","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/path-to-regexp":"^1.0.29","@types/supertest":"^6.0.2","eslint":"^9.18.0","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.2","globals":"^16.0.0","jest":"^29.7.0","prettier":"^3.4.2","source-map-support":"^0.5.21","supertest":"^7.0.0","ts-jest":"^29.2.5","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","typescript":"^5.7.3","typescript-eslint":"^8.20.0"},"repository":{"type":"git","url":"git+https://github.com/akshatV21/chaos-proxy.git"},"bugs":{"url":"https://github.com/akshatV21/chaos-proxy/issues"},"engines":{"node":">=18.0.0"},"gitHead":"72da0eb91783a23557be111331ec5338aa363f7f","_id":"@akshatv21/chaosproxy@1.0.3","homepage":"https://github.com/akshatV21/chaos-proxy#readme","_nodeVersion":"22.16.0","_npmVersion":"11.6.4","dist":{"integrity":"sha512-aGMeRVu0IPaJk8mgtIzEPjwRex5ATCd+28ym++iU4Qju/SToUSdQvv1GidhLqOyh8eGEu/9airl4VZl0rFsINg==","shasum":"0a56c528d0ef181198adf51f57c982e086d45b97","tarball":"https://registry.npmjs.org/@akshatv21/chaosproxy/-/chaosproxy-1.0.3.tgz","fileCount":34,"unpackedSize":242066,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDtVsJPxT0dQKN6IjRAhUV2XGGNovAZbi8QrVQi+eWpcQIhAOfcO9i0TydHgxTBS2FWttqrvS5GX6ay7kUZUQ1K27Wy"}]},"_npmUser":{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"},"directories":{},"maintainers":[{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chaosproxy_1.0.3_1776072252551_0.7769521734857254"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-13T09:11:17.348Z","modified":"2026-04-13T09:24:12.818Z","1.0.0":"2026-04-13T09:11:17.606Z","1.0.1":"2026-04-13T09:18:05.823Z","1.0.2":"2026-04-13T09:21:21.916Z","1.0.3":"2026-04-13T09:24:12.689Z"},"bugs":{"url":"https://github.com/akshatV21/chaos-proxy/issues"},"author":{"name":"Akshat Vishwakarma","email":"a.vishwakarma1021@gmail.com","url":"https://vishwakarma.pro"},"license":"MIT","homepage":"https://github.com/akshatV21/chaos-proxy#readme","keywords":["cli","proxy","chaos-engineering","testing","developer-tools","mocking","network"],"repository":{"type":"git","url":"git+https://github.com/akshatV21/chaos-proxy.git"},"description":"The localhost saboteur. Test your UI's resilience by breaking your API on purpose.","maintainers":[{"name":"akshatv21","email":"a.vishwakarma2110@gmail.com"}],"readme":"# ChaosProxy\n\n**The localhost saboteur. Test your UI's resilience by breaking your API on purpose.**\n\n![NPM Version](https://img.shields.io/npm/v/chaos-proxy?style=flat-square) ![License](https://img.shields.io/npm/l/chaos-proxy?style=flat-square)\n\n---\n\n## 🚩 The Problem\n\nLocal development environments are **too perfect**. On `localhost`, requests are instantaneous and servers never fail. But in the real world, networks are flaky, APIs time out, and dependencies crash.\n\nIf you only test against a \"perfect\" backend, you're ignoring the most critical parts of your User Experience: **Loading states, Error boundaries, and Network retry logic.**\n\n**ChaosProxy** solves this by sitting between your frontend and your backend, intentionally injecting chaos into your requests so you can build a truly resilient application.\n\n## 🚀 Installation\n\nInstall ChaosProxy globally via npm:\n\n```bash\nnpm install -g @akshatv21/chaosproxy\n```\n\n## ⚡ Quick Start\n\nThe fastest way to start is by using CLI flags. Proxy your traffic to a backend running on port `8080`, listen on port `3000`, and add a static `500ms` delay to every request:\n\n```bash\nchaos start -t http://localhost:8080 -p 3000 -d 500\n```\n\n**What happens next?**\nChaosProxy will spin up a reverse proxy. Any request sent to `http://localhost:3000` will be forwarded to your backend after a 500ms pause. You'll see a beautiful, color-coded log in your terminal for every intercepted request.\n\n## 🛠️ Advanced Configuration\n\nWhile flags are great for quick tests, the real power of ChaosProxy lies in the `chaos.json` configuration file. This allows you to define global rules and specific overrides for different API endpoints.\n\n### Example `chaos.json`\n\n```json\n{\n  \"server\": {\n    \"port\": 3000,\n    \"target\": \"http://localhost:8080\"\n  },\n  \"global\": {\n    \"delay\": \"100-500\",\n    \"failure\": {\n      \"rate\": 0.05,\n      \"codes\": [500]\n    }\n  },\n  \"routes\": [\n    {\n      \"path\": \"/api/health\",\n      \"delay\": 0,\n      \"failure\": { \"rate\": 0 }\n    },\n    {\n      \"path\": \"/api/checkout\",\n      \"method\": \"POST\",\n      \"delay\": 2000,\n      \"failure\": {\n        \"rate\": 0.5,\n        \"codes\": [500, 503]\n      }\n    },\n    {\n      \"path\": \"/api/users/:id\",\n      \"delay\": \"200-1000\"\n    }\n  ]\n}\n```\n\n### Configuration Schema\n\n| Property | Path                              | Type                 | Description                                                    |\n| :------- | :-------------------------------- | :------------------- | :------------------------------------------------------------- |\n| `port`   | `server.port`                     | `number`             | The local port ChaosProxy listens on. (Default: `3000`)        |\n| `target` | `server.target`                   | `string`             | The destination backend URL. (**Required**)                    |\n| `delay`  | `global.delay` / `routes[].delay` | `number` \\| `string` | A static value (e.g., `500`) or a range (e.g., `\"150-500\"`).   |\n| `rate`   | `global.failure.rate`             | `number`             | Probability of failure (0.0 to 1.0). `0.1` = 10% chance.       |\n| `codes`  | `global.failure.codes`            | `number[]`           | List of HTTP status codes to randomly return on failure.       |\n| `path`   | `routes[].path`                   | `string`             | Endpoint pattern. Supports dynamic segments (e.g., `:id`).     |\n| `method` | `routes[].method`                 | `string`             | HTTP method (GET, POST, etc). If omitted, matches all methods. |\n\n> [!TIP]\n> **Precedence Rule:** Route-specific configurations always override global configurations. If a route is matched but doesn't define a specific property (like `failure`), it will fall back to the global setting.\n\n## 📖 CLI Reference\n\n| Flag       | Alias | Description                         | Example                    |\n| :--------- | :---- | :---------------------------------- | :------------------------- |\n| `--target` | `-t`  | The backend URL to proxy to.        | `-t http://localhost:8080` |\n| `--port`   | `-p`  | The local port to listen on.        | `-p 3000`                  |\n| `--delay`  | `-d`  | Inline delay (static or range).     | `-d 100-500`               |\n| `--config` | `-c`  | Path to a `chaos.json` config file. | `-c ./chaos.json`          |\n\n## 🛠️ Local Development\n\nWant to contribute to the chaos? We'd love the help!\n\n1. **Clone and Install**\n\n   ```bash\n   git clone https://github.com/anomalyco/chaos-proxy.git\n   cd chaos-proxy\n   npm install\n   ```\n\n2. **Build and Link**\n   To test your changes locally as a global command:\n\n   ```bash\n   npm run build\n   npm link\n   ```\n\n3. **Run directly**\n   ```bash\n   npx ts-node src/main.ts start -t http://localhost:8080\n   ```\n","readmeFilename":"README.md"}