diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 9a6093e45f3..5cae55796c8 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -721,6 +721,17 @@ An integer identifier for the current thread. On the corresponding worker object (if there is any), it is available as [`worker.threadId`][]. This value is unique for each [`Worker`][] instance inside a single process. +## `worker.threadName` + + + +* {string|null} + +A string identifier for the current thread or null if the thread is not running. +On the corresponding worker object (if there is any), it is available as [`worker.threadName`][]. + ## `worker.workerData` + +* {string|null} + +A string identifier for the referenced thread or null if the thread is not running. +Inside the worker thread, it is available as [`require('node:worker_threads').threadName`][]. + ### `worker.unref()`