min-run
v1.0.0
Published
Wrap an async function to run for at least n milliseconds
Downloads
8
Readme
min-run 
Wrap an async function to run for at least n milliseconds
Install
$ npm install --save min-run
Usage
var min = require('min-run')
var getUser = min(fetch, 100)
getUser(1, function (err, user) {
//=> at least 100ms will elapse before calling
})
function fetch (id, callback) {
// ...
}
API
min(fn, [time])
-> function
fn
Required
Type: function
A Node-style async function to wrap.
time
Type: number
Default: 0
The minimum run time for the fn
.
License
MIT © Ben Drucker