AsyncCallGuard 
Make all calls to a function queued and asynchronously guarded
NPM
Install the module with: npm install asynccallguard
Usage
var AsyncCallGuard = require('asynccallguard');
var w = 100;
var f = function(){console.log(Array.prototype.slice.call(arguments));};
var f2 = AsyncCallGuard(f, function MyGuard(fcall){
w *= 2;
console.log('MyGuard was called, waiting for '+w+'ms before running f');
setTimeout(fcall, w);
});
f2();
f2(1,2);
f2(3,4);
f2(5,6,7);
Release History
v1.0.0 - Initial commit (13 apr. 2012)
License
Copyright (c) 2013 Francois-Guillaume Ribreau
Licensed under the MIT license.