Utility methods for node.js.
npm install utility-methods
var utility = require('utility-methods'); console.log(utility.max(0, 1, 2, -1)); // Output: 2
Within utility-methods souce directory, type:
Return a function which on invocation will invoke all functions within [functions]. All functions will be invoked with a 'next' handler as last argument, with the exception of the last function which is replaced with any error, if any.
Return a handler, that on invocation will forward all its arguments together with a 'next' handler to [expression]. [expression] should then invoke its 'next' handler with either true or false. Depending on the result, either [onTrue] or [onFalse] will be invoked.
Return the greatest value that was provided. Supports unlimited number of arguments.
Return a function that will wait [num] times before any call [cb] will be forwarded.
Return a function that will wait [ms] ms before cb in be automatically invoked with a timeout error if the function has not been invoked before that. The function will quarantee that [cb] is only invoked once.