Timeoutify
A module that will call the passed callback with an error if a timeout threshold is passed.
var timeoutify = // timeout after 500ms - defaults to 5000ms if omittedvar wrapped =
Other function arguments
Arguments to the wrapped function are passed through as you'd expect:
var wrapped =
Callback function
By convention the last argument to the invocation of the wrapped function is treated as a callback. If the last argument is not a function, no notification of timeouts will occur:
var wrapped = // don't care about success/failure so don't pass a callback