Async Hooks API is quite flexible. It allows you to intercept lifecycle events of async resources. If you’re interested, you may check my post on the topic: https://itnext.io/a-pragmatic-overview-of-async-hooks-api-in-node-js-e514b31460e9
While CLS is the most significant use case for Async Hooks API, it can be used various ways. I can imagine using it to build a lightweight profiler for network apps.
Although I admit that it’s not possible to implement the error handling part of domains with async hooks.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrey Pechkurov

Core database engineer at QuestDB. Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.