node:domain مُهمَلة في Node. فضّل معالجة الأخطاء الصريحة عبر Promise و EventEmitter في الشيفرة الجديدة.
يصدّر Elide Domain وcreate() وcreateDomain() وactive. ويعمل
توجيه الأخطاء المتزامنة الأساسي:
import domain from "node:domain";
const scope = domain.create();
scope.on("error", (error) => console.log(error.message));
scope.run(() => {
throw new Error("boom");
});
// boomتكشف الفئة run وbind وintercept وenter وexit و
واجهة EventEmitter. ولا يُضمن التوافق مع تدفقات domain غير المتزامنة المعقدة.
Reference
Status: Full · Not measured
domain exports
Domain, active, create, createDomain