koa-sleep

0.1.0 • Public • Published

Koa Sleep Middleware

This koa middleware will "sleep" or delay moving forward for the defined timeout.

Usage

Require the package and add it to your middleware pipeline. Takes an argument in the form of a integer representing milliseconds which defaults to 100 if none is provided.

npm install koa-sleep --save
var koa = require('koa')
var sleep = require('koa-sleep')
 
var app = koa()
 
// Sleep for 500ms
app.use(sleep(500))
 
app.use(function *(next){
  this.body = 'Hello World'  
})
 
app.listen(1337)

Package Sidebar

Install

npm i koa-sleep

Weekly Downloads

4

Version

0.1.0

License

ISC

Last publish

Collaborators

  • montanaflynn