title: using zone.js hooks in node
body: <p>I'm trying to write a simple demo using <a href="https://github.com/angular/zone.js" rel="nofollow">angular/zone.js</a> in node, but for some reason neither the <code>beforeTask</code> or <code>afterTask</code> are being called.</p>
  
  <p>Here is the code I'm running:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>require('zone.js');
  
  function foo () {
    Zone.current.fork({
      name: 'foo_zone',
      
      beforeTask: function () {
        console.log('~~~ ZONE START ~~~');
      },
      
      afterTask: function () {
        console.log('~~~ ZONE END ~~~');
      }
    })
      .run(function () {
        console.log('in the zone');
        console.log('Zone.current.name', Zone.current.name); // prints foo_zone
        setTimeout(() =&gt; {
          console.log('timeout is up');
        }, 1000);
      });
  }
  foo();</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now inside the zone everything prints fine, including the zone name, but neither of the hooks are called.</p>
  
  <p>Am I missing something basic with zone.js + node.js?</p>
  
  <p>(running with node v5.0.0, zone.js 0.6.23)</p>