Replacement for Domain in Nodejs?
Asked Answered
A

2

7

I have read many threads related to this but they are a little bit old now, that's why as Domain is still Deprecated till now has anyone found any other good alternative to using Domain or not ??

I read this post alternative-to-domain-in-nodejs and there i found zone.js, does anybody use it as domain alternative or not ?? Because as the last commit on this library was 3 years ago that's why I don't think it will be a reliable solution ??

Annular answered 26/3, 2018 at 14:43 Comment(0)
G
5

Domain isn't deprecated yet, it's pending deprecation; it won't be propery deprecated until there's a replacement. From the documentation:

This module is pending deprecation. Once a replacement API has been finalized, this module will be fully deprecated. Most end users should not have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the time being but should expect to have to migrate to a different solution in the future.

Note that last bit:

Users who absolutely must have the functionality that domains provide may rely on it for the time being...

So in terms of a replacement: Watch that page. The new API will be announced and the deprecation notice updated, presumably.

Goer answered 26/3, 2018 at 14:45 Comment(1)
Thanks for telling me that, there have been 3-4 years and still there is no replacement found :(Annular
S
1

zone.js now move to angular package, you can found it here, https://github.com/angular/angular/tree/main/packages/zone.js.

And it can work in node.js, you can find detailed information here.

https://github.com/angular/angular/blob/main/packages/zone.js/MODULE.md https://github.com/angular/angular/blob/main/packages/zone.js/NON-STANDARD-APIS.md

you can try the new version, zone.js provide some features that domain doesn't have. please tell me when you need more information.

Schuh answered 3/4, 2018 at 2:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.