Jeff-Lewis / cls-hooked

cls-hooked : CLS using AsynWrap or async_hooks instead of async-listener for node 4.7+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discussion: Porting to nodejs AsyncLocalStorage

Ghost---Shadow opened this issue · comments

Since node 13 AsyncLocalStorage has been added.

https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage

I think we should port to that.

The API looks fairly clean.

Are there any plans to do this? nodejs/node#35286 - seems like this API is much closer to being stable than Async Hooks.

For our project the plain AsyncLocalStorage is enough.

To me it looks like the porting is only useful to keep the cls-hooked API and have an updated npm package to existing projects.

I think actually that the porting will result in just a wrapping of AsyncLocalStorage methods to the cls-hook api names.

And why not @SimonX200?