I am trying to set up a small node script to play with zone.js
. But I am confused about how to require this library into node script.
My script goes as following:
var Zone = require('zone.js/dist/zone-node.js');
console.log('test...', Zone)
function main() {
foo();
setTimeout(doSomething, 2000);
bar();
baz();
}
function doSomething() {
console.log('Async task');
}
function foo() {
console.log('foo')
}
function bar() {
console.log('bar')
}
function baz() {
console.log('baz')
}
// Zone.run(main)
The imported Zone is an empty object. And what's the correct way to do it?