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

express-delay

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-delay - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

9

index.js
var timers = require('timers');
var create_delayer = function(time) {
var get_random_int = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var create_delayer = function(min, max) {
var useRandomDelay = (arguments.length === 2);
return function(req, res, next) {
var send = res.send;
var time = useRandomDelay ? get_random_int(min, max) : min;

@@ -7,0 +14,0 @@ res.send = function() {

2

package.json
{
"name": "express-delay",
"version": "0.0.1",
"version": "0.1.0",
"description": "Delay express responses",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,3 +8,3 @@ express-delay

You want to test your fancy ajax loaders, spinners and stuff, but your dev machine is to damn fast for that shit!
You want to test your fancy ajax loaders, spinners and stuff, but your dev machine is too damn fast for that shit!

@@ -28,3 +28,12 @@ ## Usage

### Random delay
You can also give it a range of values, which will make the delay random:
```javascript
// Delay will be between 200 and 500 milliseconds
app.use(delay(200, 500));
```
## LICENSE
MIT
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