Async Hooks

Async Hooks API

init(asyncId, type, triggerAsyncId, resource)

  • why can't we console.log inside init?
  • console.log itself causes resources to be created
  • only TickObject is created for each log after the first, but ONE is all we need to loop endlessly
const hook = require('./_hook-print.init.js')
console.log('hello')

hook.enable()

console.log('world')