title: Node.js consecutive method calls with nested callback formatting
body: <p>So I'm new to Node.js and Im just wondering if the way I have my code setup makes sense. Im coming from a Java background so the nested callback structure is new. I have a Node program that runs a bunch of code that I broke down into different methods. The thing is that the methods need to be called in order. My code has this structure right now:</p>
  
  <pre><code>functionOne(data, callback(err) {
  
     functionTwo(data, callback(err) {
  
        functionThree(data, callback(err) {
  
            functionFour(data, callback(err) {
               //Code
            });
  
        });
  
     });
  
  });
  </code></pre>
  
  <p>This is very minimalistic, but is this structure ok? With Java, I'd take the return values of all the methods, then just pass them to the next function. From my understanding so far, the Java approach I just mentioned is one of the main things that Node.js was trying to eliminate. But anyway... Does that structure look ok, and is that how its intended to look? Just want to be sure that I'm not making any major errors with Node in general. Thanks! </p>