title: update variable in callback
body: <p>The problem is that in he callback I tried to set <code>article.color</code>, but if I add <code>console.log(article.color)</code> after <code>color</code> it is still #FF0000 (inside <code>color</code> it detect dominant colors and work perfectly). </p>
  
  <p>How update variable inside callback?</p>
  
  <pre class="lang-js prettyprint-override"><code>var articles = JSON.parse( fs.readFileSync( 'src/articles/articles.json' , 'utf8') );
  var totalArticles = articles.length;
  var readyArticles = 0;
  
  function testReady(){
      readyArticles++;
      if(readyArticles == totalArticles){
          fs.writeFile('src/articles/articles.build.json', JSON.stringify(articles));
      }
  }
  
  articles.forEach(function( article ) {
      var imgPath = './src/'+article.background;
      article.color = '#FF0000';
  
      color( imgPath , function(err, color) {
          if( !err ){
              article.color = color;
          } else {
              console.log( err, color );
          }
      });
  
      testReady()
  });
  </code></pre>