AsyncLocalStorage API
The AsyncLocalStorage
class has been introduced in the Async Hooks module.
This API allows keeping a context across asynchronous operations. For instance, if an sequence id is stored
within an instance of AsyncLocalStorage
for each entering HTTP requests in a server, it will be possible
to retrieve this id without knowing the current HTTP request.
const http = require('http');