diff --git a/doc/api/process.md b/doc/api/process.md index 61ea3c673e5f19..6319270ef0b7a4 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -4308,6 +4308,32 @@ Assigning a value to `process.title` might not result in an accurate label within process manager applications such as macOS Activity Monitor or Windows Services Manager. +As an alternative to direct assignment, use [`process.setTitle()`][]. + +## `process.setTitle(title)` + + + +* `title` {string} + +Sets the process title. This is equivalent to assigning a string to +[`process.title`][]. See [`process.title`][] for restrictions and platform +limitations. + +```mjs +import { setTitle } from 'node:process'; + +setTitle('my-service'); +``` + +```cjs +const { setTitle } = require('node:process'); + +setTitle('my-service'); +``` + ## `process.traceDeprecation`