Alternative to domain in nodejs
Asked Answered
F

1

9

As nodev4.2.1 is released and the domain is marked as the deprecated, so now I will require the alternative of it.

Earlier I used to store the request level variable in domain so that I can use those variables in the other processes of finding data within the same context of the request.

Is there any way where we can achieve it?

Note: I can not use request or response object to store my data.

Flipflop answered 15/10, 2015 at 13:24 Comment(1)
just curious why you cant use req or res to store data?Lotti
N
2

zone.js is something i believe can provide the solution: https://github.com/btford/zone.js/

it has much more capabilies

Nunnally answered 15/10, 2015 at 14:16 Comment(4)
Thanks Sagie for the solution. But can I write the different context-storage module? Where should I put the variables in this case? Can I use process to input the data?Flipflop
Its unclear if this project is moving forward at all. The implementation status is patchy, and there have been no commits for nearly a year now.Pacifism
Maybe so, but if it's working good and provides you the features you need than I don't an issue.Nunnally
ZoneJS does not support native async/await, so pretty much useless in modern Javascript.Indolence

© 2022 - 2024 — McMap. All rights reserved.