Wrap an async function to run for at least n milliseconds
$ npm install --save min-run
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) {
// ...
}
Required
Type: function
A Node-style async function to wrap.
Type: number
Default: 0
The minimum run time for the fn
.
MIT © Ben Drucker