Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

connect-chaos

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-chaos

connect / express middleware that causes chaos

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

connect-chaos

Circle CI

Connect / Express middleware that causes chaos

This is loosely inspired by chaos monkey. The basic idea is that you can drop it into your connect / express app and see how your clients get on when things go wrong. You might want to have it enabled by an environment variable so you can switch it on and off easily.

Installation

$ npm install connect-chaos

Usage

var chaos = require('connect-chaos');

// anything can happen
app.use(chaos());

// requests might be delayed by 2000ms (default)
app.use(chaos({
  delay: true
});

// requests might be delayed by specified value
app.use(chaos({
  delay: 300
});

// requests might return an error code
// Client error codes: 400, 401, 402, 403, 404, 405, 406, 407, 407, 409, 410, 411, 412, 413, 414, 415, 416, 417
// Server Error codes: 500, 501, 502, 503, 504, 505
app.use(chaos({
  error: true
});

// requests might return specified code
app.use(chaos({
  error: 401
});

// requests might return a code in the array
app.use(chaos({
  error: [404, 500]
}));

// requests might return a code that matches the regex
app.use(chaos(){
  error: /^40/
});

// requests might return an erro code or be delayed by 6000ms
app.use(chaos({
  error: true,
  delay: 6000
});

Keywords

FAQs

Package last updated on 26 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc