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.

Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.

Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.