Management of complex chains of asynchronous operations in Javascript for both the browser and node.js