title: How do I convert an existing callback API to promises?
body: <p>I want to work with promises but I have a callback API in a format like:</p>
  
  <h3>1. DOM load or other one time event:</h3>
  
  <pre><code>window.onload; // set to callback
  ...
  window.onload = function() {
  
  };
  </code></pre>
  
  <h3>2. Plain callback:</h3>
  
  <pre><code>function request(onChangeHandler) {
      ...
  }
  request(function() {
      // change happened
      ...
  });
  </code></pre>
  
  <h3>3. Node style callback ("nodeback"):</h3>
  
  <pre><code>function getStuff(dat, callback) {
      ...
  }
  getStuff("dataParam", function(err, data) {
      ...
  })
  </code></pre>
  
  <h3>4. A whole library with node style callbacks:</h3>
  
  <pre><code>API;
  API.one(function(err, data) {
      API.two(function(err, data2) {
          API.three(function(err, data3) {
              ...
          });
      });
  });
  </code></pre>
  
  <h3>How do I work with the API in promises, how do I "promisify" it?</h3>