title: Node.js Asynchronous Function *Definition*
body: <p>Please, just to clear something up in my head...</p>
  
  <p>I am used to writing using asynchronous functions in libraries, but how do I write my own?</p>
  
  <p>To illustrate my question I have made up a module called 'MadMathz'</p>
  
  <p>I am aware that the following is an example usage of an asynchronous function :</p>
  
  <pre><code>//load module
  var mM = require('./MadMathz');
  
  //perform a function
  mM.async_function_addthree(12, function(result) {
    console.log(result)
  });
  
  //do something straight afterwards
  console.log('Logging this straight after instead of waiting for computation');
  </code></pre>
  
  <p>I'm aware that the second argument to the function is the callback, but how is a function such as 'async_function_addthree' defined? Let's say for the purpose of this example that async_function_addthree just adds 3 to the first argument.</p>
  
  <p>I just confused myself so much trying to write what I thought it might be. Am I totally on the wrong track? I feel like I am close to getting there with node.js but this needs clearing up.</p>
  
  <p>Please explain rather than linking me somewhere if possible. I'm sure others will benefit from this question.</p>