"desc":"<p>Node.js may deprecate APIs for any of the following reasons:</p>\n<ul>\n<li>Use of the API is unsafe.</li>\n<li>An improved alternative API is available.</li>\n<li>Breaking changes to the API are expected in a future major release.</li>\n</ul>\n<p>Node.js utilizes three kinds of Deprecations:</p>\n<ul>\n<li>Documentation-only</li>\n<li>Runtime</li>\n<li>End-of-Life</li>\n</ul>\n<p>A Documentation-only deprecation is one that is expressed only within the\nNode.js API docs. These generate no side-effects while running Node.js.\nSome Documentation-only deprecations trigger a runtime warning when launched\nwith <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a> flag (or its alternative,\n<code>NODE_PENDING_DEPRECATION=1</code> environment variable), similarly to Runtime\ndeprecations below. Documentation-only deprecations that support that flag\nare explicitly labeled as such in the\n<a href=\"#deprecations_list_of_deprecated_apis\">list of Deprecated APIs</a>.</p>\n<p>A Runtime deprecation will, by default, generate a process warning that will\nbe printed to <code>stderr</code> the first time the deprecated API is used. When the\n<a href=\"cli.html#cli_throw_deprecation\"><code>--throw-deprecation</code></a> command-line flag is used, a Runtime deprecation will\ncause an error to be thrown.</p>\n<p>An End-of-Life deprecation is used when functionality is or will soon be removed\nfrom Node.js.</p>",
"miscs":[
{
"textRaw":"Revoking deprecations",
"name":"revoking_deprecations",
"desc":"<p>Occasionally, the deprecation of an API may be reversed. In such situations,\nthis document will be updated with information relevant to the decision.\nHowever, the deprecation identifier will not be modified.</p>",
"desc":"<p>Type: End-of-Life</p>\n<p>The <code>_linklist</code> module is deprecated. Please use a userland alternative.</p>\n<p><a id=\"DEP0003\"></a></p>",
"desc":"<p>Type: Runtime (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>The <code>Buffer()</code> function and <code>new Buffer()</code> constructor are deprecated due to\nAPI usability issues that can lead to accidental security issues.</p>\n<p>As an alternative, use one of the following methods of constructing <code>Buffer</code>\nobjects:</p>\n<ul>\n<li><a href=\"buffer.html#buffer_static_method_buffer_alloc_size_fill_encoding\"><code>Buffer.alloc(size[, fill[, encoding]])</code></a>: Create a <code>Buffer</code> with\n<em>initialized</em> memory.</li>\n<li><a href=\"buffer.html#buffer_static_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe(size)</code></a>: Create a <code>Buffer</code> with\n<em>uninitialized</em> memory.</li>\n<li><a href=\"buffer.html#buffer_static_method_buffer_allocunsafeslow_size\"><code>Buffer.allocUnsafeSlow(size)</code></a>: Create a <code>Buffer</code> with <em>uninitialized</em>\nmemory.</li>\n<li><a href=\"buffer.html#buffer_static_method_buffer_from_array\"><code>Buffer.from(array)</code></a>: Create a <code>Buffer</code> with a copy of <code>array</code></li>\n<li><a href=\"buffer.html#buffer_static_method_buffer_from_arraybuffer_byteoffset_length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a> -\nCreate a <code>Buffer</code> that wraps the given <code>arrayBuffer</code>.</li>\n<li><a href=\"buffer.html#buffer_static_method_buffer_from_buffer\"><code>Buffer.from(buffer)</code></a>: Create a <code>Buffer</code> that copies <code>buffer</code>.</li>\n<li><a href=\"buffer.html#buffer_static_method_buffer_from_string_encoding\"><code>Buffer.from(string[, encoding])</code></a>: Create a <code>Buffer</code>\nthat copies <code>string</code>.</li>\n</ul>\n<p>Without <code>--pending-deprecation</code>, runtime warnings occur only for code not in\n<code>node_modules</code>. This means there will not be deprecation warnings for\n<code>Buffer()</code> usage in dependencies. With <code>--pending-deprecation</code>, a runtime\nwarning results no matter where the <code>Buffer()</code> usage occurs.</p>\n<p><a id=\"DEP0006\"></a></p>",
"description":"A deprecation code has been assigned."
},
{
"version":"v0.11.14",
"description":"Runtime deprecation."
},
{
"version":"v0.5.11",
"description":"Documentation-only deprecation."
}
]
},
"desc":"<p>Type: End-of-Life</p>\n<p>Within the <a href=\"child_process.html\"><code>child_process</code></a> module's <code>spawn()</code>, <code>fork()</code>, and <code>exec()</code>\nmethods, the <code>options.customFds</code> option is deprecated. The <code>options.stdio</code>\noption should be used instead.</p>\n<p><a id=\"DEP0007\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>In an earlier version of the Node.js <code>cluster</code>, a boolean property with the name\n<code>suicide</code> was added to the <code>Worker</code> object. The intent of this property was to\nprovide an indication of how and why the <code>Worker</code> instance exited. In Node.js\n6.0.0, the old property was deprecated and replaced with a new\n<a href=\"cluster.html#cluster_worker_exitedafterdisconnect\"><code>worker.exitedAfterDisconnect</code></a> property. The old property name did not\nprecisely describe the actual semantics and was unnecessarily emotion-laden.</p>\n<p><a id=\"DEP0008\"></a></p>",
"type":"module",
"displayName":"DEP0007: Replace `cluster` `worker.suicide` with `worker.exitedAfterDisconnect`"
"desc":"<p>Type: Documentation-only</p>\n<p>The <code>constants</code> module is deprecated. When requiring access to constants\nrelevant to specific Node.js builtin modules, developers should instead refer\nto the <code>constants</code> property exposed by the relevant module. For instance,\n<code>require('fs').constants</code> and <code>require('os').constants</code>.</p>\n<p><a id=\"DEP0009\"></a></p>",
"type":"module",
"displayName":"DEP0008: `require('constants')`"
},
{
"textRaw":"DEP0009: `crypto.pbkdf2` without digest",
"desc":"<p>Type: Runtime</p>\n<p>Use of the <a href=\"crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback\"><code>crypto.pbkdf2()</code></a> API without specifying a digest was deprecated\nin Node.js 6.0 because the method defaulted to using the non-recommended\n<code>'SHA1'</code> digest. Previously, a deprecation warning was printed. Starting in\nNode.js 8.0.0, calling <code>crypto.pbkdf2()</code> or <code>crypto.pbkdf2Sync()</code> with\n<code>digest</code> set to <code>undefined</code> will throw a <code>TypeError</code>.</p>\n<p>Beginning in Node.js v11.0.0, calling these functions with <code>digest</code> set to\n<code>null</code> will print a deprecation warning to align with the behavior when <code>digest</code>\nis <code>undefined</code>.</p>\n<p><a id=\"DEP0010\"></a></p>",
"type":"module",
"displayName":"DEP0009: `crypto.pbkdf2` without digest"
"desc":"<p>Type: End-of-Life</p>\n<p>The <code>crypto.Credentials</code> class was removed. Please use <a href=\"tls.html#tls_tls_createsecurecontext_options\"><code>tls.SecureContext</code></a>\ninstead.</p>\n<p><a id=\"DEP0012\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>Domain.dispose()</code> has been removed. Recover from failed I/O actions\nexplicitly via error event handlers set on the domain instead.</p>\n<p><a id=\"DEP0013\"></a></p>",
"type":"module",
"displayName":"DEP0012: `Domain.dispose`"
},
{
"textRaw":"DEP0013: `fs` asynchronous function without callback",
"desc":"<p>Type: End-of-Life</p>\n<p>Calling an asynchronous function without a callback throws a <code>TypeError</code>\nin Node.js 10.0.0 onwards. See <a href=\"https://github.com/nodejs/node/pull/12562\">https://github.com/nodejs/node/pull/12562</a>.</p>\n<p><a id=\"DEP0014\"></a></p>",
"type":"module",
"displayName":"DEP0013: `fs` asynchronous function without callback"
"desc":"<p>Type: End-of-Life</p>\n<p>The <a href=\"fs.html#fs_fs_read_fd_buffer_offset_length_position_callback\"><code>fs.read()</code></a> legacy <code>String</code> interface is deprecated. Use the <code>Buffer</code>\nAPI as mentioned in the documentation instead.</p>\n<p><a id=\"DEP0015\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>The <a href=\"fs.html#fs_fs_readsync_fd_buffer_offset_length_position\"><code>fs.readSync()</code></a> legacy <code>String</code> interface is deprecated. Use the\n<code>Buffer</code> API as mentioned in the documentation instead.</p>\n<p><a id=\"DEP0016\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The <code>GLOBAL</code> and <code>root</code> aliases for the <code>global</code> property are deprecated\nand should no longer be used.</p>\n<p><a id=\"DEP0017\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>Intl.v8BreakIterator</code> was a non-standard extension and has been removed.\nSee <a href=\"https://github.com/tc39/proposal-intl-segmenter\"><code>Intl.Segmenter</code></a>.</p>\n<p><a id=\"DEP0018\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>Unhandled promise rejections are deprecated. In the future, promise rejections\nthat are not handled will terminate the Node.js process with a non-zero exit\ncode.</p>\n<p><a id=\"DEP0019\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>In certain cases, <code>require('.')</code> could resolve outside the package directory.\nThis behavior has been removed.</p>\n<p><a id=\"DEP0020\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The <code>os.tmpDir()</code> API is deprecated. Please use <a href=\"os.html#os_os_tmpdir\"><code>os.tmpdir()</code></a> instead.</p>\n<p><a id=\"DEP0023\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>The <code>REPLServer.prototype.convertToContext()</code> API has been removed.</p>\n<p><a id=\"DEP0025\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The <code>sys</code> module is deprecated. Please use the <a href=\"util.html\"><code>util</code></a> module instead.</p>\n<p><a id=\"DEP0026\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>util.print()</code> has been removed. Please use <a href=\"console.html#console_console_log_data_args\"><code>console.log()</code></a> instead.</p>\n<p><a id=\"DEP0027\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>util.puts()</code> has been removed. Please use <a href=\"console.html#console_console_log_data_args\"><code>console.log()</code></a> instead.</p>\n<p><a id=\"DEP0028\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>util.debug()</code> has been removed. Please use <a href=\"console.html#console_console_error_data_args\"><code>console.error()</code></a> instead.</p>\n<p><a id=\"DEP0029\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>util.error()</code> has been removed. Please use <a href=\"console.html#console_console_error_data_args\"><code>console.error()</code></a> instead.</p>\n<p><a id=\"DEP0030\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"crypto.html#crypto_ecdh_setpublickey_publickey_encoding\"><code>ecdh.setPublicKey()</code></a> method is now deprecated as its inclusion in the\nAPI is not useful.</p>\n<p><a id=\"DEP0032\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"domain.html\"><code>domain</code></a> module is deprecated and should not be used.</p>\n<p><a id=\"DEP0033\"></a></p>",
"description":"A deprecation code has been assigned."
},
{
"version":"v0.4.7",
"description":"Documentation-only deprecation."
}
]
},
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"fs.html#fs_fs_lchmod_path_mode_callback\"><code>fs.lchmod(path, mode, callback)</code></a> API is deprecated.</p>\n<p><a id=\"DEP0036\"></a></p>",
"description":"A deprecation code has been assigned."
},
{
"version":"v0.4.7",
"description":"Documentation-only deprecation."
}
]
},
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"fs.html#fs_fs_lchmodsync_path_mode\"><code>fs.lchmodSync(path, mode)</code></a> API is deprecated.</p>\n<p><a id=\"DEP0037\"></a></p>",
"description":"A deprecation code has been assigned."
},
{
"version":"v0.4.7",
"description":"Documentation-only deprecation."
}
]
},
"desc":"<p>Type: Deprecation revoked</p>\n<p>The <a href=\"fs.html#fs_fs_lchown_path_uid_gid_callback\"><code>fs.lchown(path, uid, gid, callback)</code></a> API was deprecated. The\ndeprecation was revoked because the requisite supporting APIs were added in\nlibuv.</p>\n<p><a id=\"DEP0038\"></a></p>",
"description":"A deprecation code has been assigned."
},
{
"version":"v0.4.7",
"description":"Documentation-only deprecation."
}
]
},
"desc":"<p>Type: Deprecation revoked</p>\n<p>The <a href=\"fs.html#fs_fs_lchownsync_path_uid_gid\"><code>fs.lchownSync(path, uid, gid)</code></a> API was deprecated. The deprecation was\nrevoked because the requisite supporting APIs were added in libuv.</p>\n<p><a id=\"DEP0039\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"punycode.html\"><code>punycode</code></a> module is deprecated. Please use a userland alternative\ninstead.</p>\n<p><a id=\"DEP0041\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isarray_object\"><code>util.isArray()</code></a> API is deprecated. Please use <code>Array.isArray()</code>\ninstead.</p>\n<p><a id=\"DEP0045\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isboolean_object\"><code>util.isBoolean()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0046\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isdate_object\"><code>util.isDate()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0048\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_iserror_object\"><code>util.isError()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0049\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isfunction_object\"><code>util.isFunction()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0050\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isnull_object\"><code>util.isNull()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0051\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isnullorundefined_object\"><code>util.isNullOrUndefined()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0052\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isnumber_object\"><code>util.isNumber()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0053\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isobject_object\"><code>util.isObject()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0054\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isprimitive_object\"><code>util.isPrimitive()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0055\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isregexp_object\"><code>util.isRegExp()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0056\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isstring_object\"><code>util.isString()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0057\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_issymbol_object\"><code>util.isSymbol()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0058\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isundefined_object\"><code>util.isUndefined()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0059\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_log_string\"><code>util.log()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0060\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_extend_target_source\"><code>util._extend()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0061\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>The <code>fs.SyncWriteStream</code> class was never intended to be a publicly accessible\nAPI and has been removed. No alternative API is available. Please use a userland\nalternative.</p>\n<p><a id=\"DEP0062\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>--debug</code> activates the legacy V8 debugger interface, which was removed as\nof V8 5.8. It is replaced by Inspector which is activated with <code>--inspect</code>\ninstead.</p>\n<p><a id=\"DEP0063\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <code>http</code> module <code>ServerResponse.prototype.writeHeader()</code> API is\ndeprecated. Please use <code>ServerResponse.prototype.writeHead()</code> instead.</p>\n<p>The <code>ServerResponse.prototype.writeHeader()</code> method was never documented as an\nofficially supported API.</p>\n<p><a id=\"DEP0064\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The <code>tls.createSecurePair()</code> API was deprecated in documentation in Node.js\n0.11.3. Users should use <code>tls.Socket</code> instead.</p>\n<p><a id=\"DEP0065\"></a></p>",
"type":"module",
"displayName":"DEP0064: `tls.createSecurePair()`"
},
{
"textRaw":"DEP0065: `repl.REPL_MODE_MAGIC` and `NODE_REPL_MODE=magic`",
"desc":"<p>Type: End-of-Life</p>\n<p>The <code>repl</code> module's <code>REPL_MODE_MAGIC</code> constant, used for <code>replMode</code> option, has\nbeen removed. Its behavior has been functionally identical to that of\n<code>REPL_MODE_SLOPPY</code> since Node.js 6.0.0, when V8 5.0 was imported. Please use\n<code>REPL_MODE_SLOPPY</code> instead.</p>\n<p>The <code>NODE_REPL_MODE</code> environment variable is used to set the underlying\n<code>replMode</code> of an interactive <code>node</code> session. Its value, <code>magic</code>, is also\nremoved. Please use <code>sloppy</code> instead.</p>\n<p><a id=\"DEP0066\"></a></p>",
"type":"module",
"displayName":"DEP0065: `repl.REPL_MODE_MAGIC` and `NODE_REPL_MODE=magic`"
"desc":"<p>Type: Runtime</p>\n<p>The <code>http</code> module <code>OutgoingMessage.prototype._headers</code> and\n<code>OutgoingMessage.prototype._headerNames</code> properties are deprecated. Use one of\nthe public methods (e.g. <code>OutgoingMessage.prototype.getHeader()</code>,\n<code>OutgoingMessage.prototype.getHeaders()</code>,\n<code>OutgoingMessage.prototype.getHeaderNames()</code>,\n<code>OutgoingMessage.prototype.hasHeader()</code>,\n<code>OutgoingMessage.prototype.removeHeader()</code>,\n<code>OutgoingMessage.prototype.setHeader()</code>) for working with outgoing headers.</p>\n<p>The <code>OutgoingMessage.prototype._headers</code> and\n<code>OutgoingMessage.prototype._headerNames</code> properties were never documented as\nofficially supported properties.</p>\n<p><a id=\"DEP0067\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p><code>node debug</code> corresponds to the legacy CLI debugger which has been replaced with\na V8-inspector based CLI debugger available through <code>node inspect</code>.</p>\n<p><a id=\"DEP0069\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>DebugContext has been removed in V8 and is not available in Node.js 10+.</p>\n<p>DebugContext was an experimental API.</p>\n<p><a id=\"DEP0070\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>async_hooks.currentId()</code> was renamed to <code>async_hooks.executionAsyncId()</code> for\nclarity.</p>\n<p>This change was made while <code>async_hooks</code> was an experimental API.</p>\n<p><a id=\"DEP0071\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>async_hooks.triggerId()</code> was renamed to <code>async_hooks.triggerAsyncId()</code> for\nclarity.</p>\n<p>This change was made while <code>async_hooks</code> was an experimental API.</p>\n<p><a id=\"DEP0072\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>async_hooks.AsyncResource.triggerId()</code> was renamed to\n<code>async_hooks.AsyncResource.triggerAsyncId()</code> for clarity.</p>\n<p>This change was made while <code>async_hooks</code> was an experimental API.</p>\n<p><a id=\"DEP0073\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>Accessing several internal, undocumented properties of <code>net.Server</code> instances\nwith inappropriate names is deprecated.</p>\n<p>As the original API was undocumented and not generally useful for non-internal\ncode, no replacement API is provided.</p>\n<p><a id=\"DEP0074\"></a></p>",
"type":"module",
"displayName":"DEP0073: Several internal properties of `net.Server`"
"desc":"<p>Type: Runtime</p>\n<p><code>tls.parseCertString()</code> is a trivial parsing helper that was made public by\nmistake. This function can usually be replaced with:</p>\n<pre><code class=\"language-js\">const querystring = require('querystring');\nquerystring.parse(str, '\\n', '=');\n</code></pre>\n<p>This function is not completely equivalent to <code>querystring.parse()</code>. One\ndifference is that <code>querystring.parse()</code> does url decoding:</p>\n<pre><code class=\"language-console\">> querystring.parse('%E5%A5%BD=1', '\\n', '=');\n{ '好': '1' }\n> tls.parseCertString('%E5%A5%BD=1');\n{ '%E5%A5%BD': '1' }\n</code></pre>\n<p><a id=\"DEP0077\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p><code>Module._debug()</code> is deprecated.</p>\n<p>The <code>Module._debug()</code> function was never documented as an officially\nsupported API.</p>\n<p><a id=\"DEP0078\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p><code>REPLServer.turnOffEditorMode()</code> was removed from userland visibility.</p>\n<p><a id=\"DEP0079\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>Using a property named <code>inspect</code> on an object to specify a custom inspection\nfunction for <a href=\"util.html#util_util_inspect_object_options\"><code>util.inspect()</code></a> is deprecated. Use <a href=\"util.html#util_util_inspect_custom\"><code>util.inspect.custom</code></a>\ninstead. For backward compatibility with Node.js prior to version 6.4.0, both\nmay be specified.</p>\n<p><a id=\"DEP0080\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The internal <code>path._makeLong()</code> was not intended for public use. However,\nuserland modules have found it useful. The internal API is deprecated\nand replaced with an identical, public <code>path.toNamespacedPath()</code> method.</p>\n<p><a id=\"DEP0081\"></a></p>",
"type":"module",
"displayName":"DEP0080: `path._makeLong()`"
},
{
"textRaw":"DEP0081: `fs.truncate()` using a file descriptor",
"desc":"<p>Type: Runtime</p>\n<p><code>fs.truncate()</code> <code>fs.truncateSync()</code> usage with a file descriptor is\ndeprecated. Please use <code>fs.ftruncate()</code> or <code>fs.ftruncateSync()</code> to work with\nfile descriptors.</p>\n<p><a id=\"DEP0082\"></a></p>",
"type":"module",
"displayName":"DEP0081: `fs.truncate()` using a file descriptor"
"desc":"<p>Type: Runtime</p>\n<p><code>REPLServer.prototype.memory()</code> is only necessary for the internal mechanics of\nthe <code>REPLServer</code> itself. Do not use this function.</p>\n<p><a id=\"DEP0083\"></a></p>",
"desc":"<p>Type: End-of-Life.</p>\n<p>The <code>ecdhCurve</code> option to <code>tls.createSecureContext()</code> and <code>tls.TLSSocket</code> could\nbe set to <code>false</code> to disable ECDH entirely on the server only. This mode was\ndeprecated in preparation for migrating to OpenSSL 1.1.0 and consistency with\nthe client and is now unsupported. Use the <code>ciphers</code> parameter instead.</p>\n<p><a id=\"DEP0084\"></a></p>",
"type":"module",
"displayName":"DEP0083: Disabling ECDH by setting `ecdhCurve` to `false`"
"desc":"<p>Type: End-of-Life</p>\n<p>Since Node.js versions 4.4.0 and 5.2.0, several modules only intended for\ninternal usage were mistakenly exposed to user code through <code>require()</code>. These\nmodules were:</p>\n<ul>\n<li><code>v8/tools/codemap</code></li>\n<li><code>v8/tools/consarray</code></li>\n<li><code>v8/tools/csvparser</code></li>\n<li><code>v8/tools/logreader</code></li>\n<li><code>v8/tools/profile_view</code></li>\n<li><code>v8/tools/profile</code></li>\n<li><code>v8/tools/SourceMap</code></li>\n<li><code>v8/tools/splaytree</code></li>\n<li><code>v8/tools/tickprocessor-driver</code></li>\n<li><code>v8/tools/tickprocessor</code></li>\n<li><code>node-inspect/lib/_inspect</code> (from 7.6.0)</li>\n<li><code>node-inspect/lib/internal/inspect_client</code> (from 7.6.0)</li>\n<li><code>node-inspect/lib/internal/inspect_repl</code> (from 7.6.0)</li>\n</ul>\n<p>The <code>v8/*</code> modules do not have any exports, and if not imported in a specific\norder would in fact throw errors. As such there are virtually no legitimate use\ncases for importing them through <code>require()</code>.</p>\n<p>On the other hand, <code>node-inspect</code> may be installed locally through a package\nmanager, as it is published on the npm registry under the same name. No source\ncode modification is necessary if that is done.</p>\n<p><a id=\"DEP0085\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>The AsyncHooks sensitive API was never documented and had various minor issues.\nUse the <code>AsyncResource</code> API instead. See\n<a href=\"https://github.com/nodejs/node/issues/15572\">https://github.com/nodejs/node/issues/15572</a>.</p>\n<p><a id=\"DEP0086\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>runInAsyncIdScope</code> doesn't emit the <code>'before'</code> or <code>'after'</code> event and can thus\ncause a lot of issues. See <a href=\"https://github.com/nodejs/node/issues/14328\">https://github.com/nodejs/node/issues/14328</a>.</p>\n<p><a id=\"DEP0089\"></a></p>",
"desc":"<p>Type: Deprecation revoked</p>\n<p>Importing assert directly was not recommended as the exposed functions use\nloose equality checks. The deprecation was revoked because use of the <code>assert</code>\nmodule is not discouraged, and the deprecation caused developer confusion.</p>\n<p><a id=\"DEP0090\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>Node.js used to support all GCM authentication tag lengths which are accepted by\nOpenSSL when calling <a href=\"crypto.html#crypto_decipher_setauthtag_buffer\"><code>decipher.setAuthTag()</code></a>. Beginning with Node.js\nv11.0.0, only authentication tag lengths of 128, 120, 112, 104, 96, 64, and 32\nbits are allowed. Authentication tags of other lengths are invalid per\n<a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf\">NIST SP 800-38D</a>.</p>\n<p><a id=\"DEP0091\"></a></p>",
"type":"module",
"displayName":"DEP0090: Invalid GCM authentication tag lengths"
"desc":"<p>Type: Documentation-only</p>\n<p>Assigning properties to the top-level <code>this</code> as an alternative\nto <code>module.exports</code> is deprecated. Developers should use <code>exports</code>\nor <code>module.exports</code> instead.</p>\n<p><a id=\"DEP0093\"></a></p>",
"type":"module",
"displayName":"DEP0092: Top-level `this` bound to `module.exports`"
},
{
"textRaw":"DEP0093: `crypto.fips` is deprecated and replaced.",
"desc":"<p>Type: Runtime</p>\n<p>Using <code>assert.fail()</code> with more than one argument is deprecated. Use\n<code>assert.fail()</code> with only one argument or use a different <code>assert</code> module\nmethod.</p>\n<p><a id=\"DEP0095\"></a></p>",
"type":"module",
"displayName":"DEP0094: Using `assert.fail()` with more than one argument."
"desc":"<p>Type: Runtime</p>\n<p><code>timers.enroll()</code> is deprecated. Please use the publicly documented\n<a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> or <a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a> instead.</p>\n<p><a id=\"DEP0096\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p><code>timers.unenroll()</code> is deprecated. Please use the publicly documented\n<a href=\"timers.html#timers_cleartimeout_timeout\"><code>clearTimeout()</code></a> or <a href=\"timers.html#timers_clearinterval_timeout\"><code>clearInterval()</code></a> instead.</p>\n<p><a id=\"DEP0097\"></a></p>",
"type":"module",
"displayName":"DEP0096: `timers.unenroll()`"
},
{
"textRaw":"DEP0097: `MakeCallback` with `domain` property",
"desc":"<p>Type: Runtime</p>\n<p>Users of <code>MakeCallback</code> that add the <code>domain</code> property to carry context,\nshould start using the <code>async_context</code> variant of <code>MakeCallback</code> or\n<code>CallbackScope</code>, or the high-level <code>AsyncResource</code> class.</p>\n<p><a id=\"DEP0098\"></a></p>",
"type":"module",
"displayName":"DEP0097: `MakeCallback` with `domain` property"
"desc":"<p>Type: End-of-Life</p>\n<p>The embedded API provided by AsyncHooks exposes <code>.emitBefore()</code> and\n<code>.emitAfter()</code> methods which are very easy to use incorrectly which can lead\nto unrecoverable errors.</p>\n<p>Use <a href=\"async_hooks.html#async_hooks_asyncresource_runinasyncscope_fn_thisarg_args\"><code>asyncResource.runInAsyncScope()</code></a> API instead which provides a much\nsafer, and more convenient, alternative. See\n<a href=\"https://github.com/nodejs/node/pull/18513\">https://github.com/nodejs/node/pull/18513</a>.</p>\n<p><a id=\"DEP0099\"></a></p>",
"desc":"<p>Type: Compile-time</p>\n<p>Certain versions of <code>node::MakeCallback</code> APIs available to native modules are\ndeprecated. Please use the versions of the API that accept an <code>async_context</code>\nparameter.</p>\n<p><a id=\"DEP0100\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p><code>process.assert()</code> is deprecated. Please use the <a href=\"assert.html\"><code>assert</code></a> module instead.</p>\n<p>This was never a documented feature.</p>\n<p><a id=\"DEP0101\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>Using the <code>noAssert</code> argument has no functionality anymore. All input is going\nto be verified, no matter if it is set to true or not. Skipping the verification\ncould lead to hard to find errors and crashes.</p>\n<p><a id=\"DEP0103\"></a></p>",
"type":"module",
"displayName":"DEP0102: Using `noAssert` in `Buffer#(read|write)` operations."
"desc":"<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>Using <code>process.binding()</code> in general should be avoided. The type checking\nmethods in particular can be replaced by using <a href=\"util.html#util_util_types\"><code>util.types</code></a>.</p>\n<p>This deprecation has been superseded by the deprecation of the\n<code>process.binding()</code> API (<a href=\"#DEP0111\">DEP0111</a>).</p>\n<p><a id=\"DEP0104\"></a></p>",
"desc":"<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>When assigning a non-string property to <a href=\"process.html#process_process_env\"><code>process.env</code></a>, the assigned value is\nimplicitly converted to a string. This behavior is deprecated if the assigned\nvalue is not a string, boolean, or number. In the future, such assignment may\nresult in a thrown error. Please convert the property to a string before\nassigning it to <code>process.env</code>.</p>\n<p><a id=\"DEP0105\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>decipher.finaltol()</code> has never been documented and was an alias for\n<a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a>. This API has been removed, and it is recommended to use\n<a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> instead.</p>\n<p><a id=\"DEP0106\"></a></p>",
"type":"module",
"displayName":"DEP0105: `decipher.finaltol`"
},
{
"textRaw":"DEP0106: `crypto.createCipher` and `crypto.createDecipher`",
"desc":"<p>Type: Runtime</p>\n<p>Using <a href=\"crypto.html#crypto_crypto_createcipher_algorithm_password_options\"><code>crypto.createCipher()</code></a> and <a href=\"crypto.html#crypto_crypto_createdecipher_algorithm_password_options\"><code>crypto.createDecipher()</code></a> should be\navoided as they use a weak key derivation function (MD5 with no salt) and static\ninitialization vectors. It is recommended to derive a key using\n<a href=\"crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback\"><code>crypto.pbkdf2()</code></a> or <a href=\"crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback\"><code>crypto.scrypt()</code></a> and to use\n<a href=\"crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options\"><code>crypto.createCipheriv()</code></a> and <a href=\"crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options\"><code>crypto.createDecipheriv()</code></a> to obtain the\n<a href=\"crypto.html#crypto_class_cipher\"><code>Cipher</code></a> and <a href=\"crypto.html#crypto_class_decipher\"><code>Decipher</code></a> objects respectively.</p>\n<p><a id=\"DEP0107\"></a></p>",
"type":"module",
"displayName":"DEP0106: `crypto.createCipher` and `crypto.createDecipher`"
"desc":"<p>Type: End-of-Life</p>\n<p>This was an undocumented helper function not intended for use outside Node.js\ncore and obsoleted by the removal of NPN (Next Protocol Negotiation) support.</p>\n<p><a id=\"DEP0108\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>Deprecated alias for <a href=\"zlib.html#zlib_zlib_byteswritten\"><code>zlib.bytesWritten</code></a>. This original name was chosen\nbecause it also made sense to interpret the value as the number of bytes\nread by the engine, but is inconsistent with other streams in Node.js that\nexpose values under these names.</p>\n<p><a id=\"DEP0109\"></a></p>",
"type":"module",
"displayName":"DEP0108: `zlib.bytesRead`"
},
{
"textRaw":"DEP0109: `http`, `https`, and `tls` support for invalid URLs",
"desc":"<p>Type: Runtime</p>\n<p>Some previously supported (but strictly invalid) URLs were accepted through the\n<a href=\"http.html#http_http_request_options_callback\"><code>http.request()</code></a>, <a href=\"http.html#http_http_get_options_callback\"><code>http.get()</code></a>, <a href=\"https.html#https_https_request_options_callback\"><code>https.request()</code></a>,\n<a href=\"https.html#https_https_get_options_callback\"><code>https.get()</code></a>, and <a href=\"tls.html#tls_tls_checkserveridentity_hostname_cert\"><code>tls.checkServerIdentity()</code></a> APIs because those were\naccepted by the legacy <code>url.parse()</code> API. The mentioned APIs now use the WHATWG\nURL parser that requires strictly valid URLs. Passing an invalid URL is\ndeprecated and support will be removed in the future.</p>\n<p><a id=\"DEP0110\"></a></p>",
"type":"module",
"displayName":"DEP0109: `http`, `https`, and `tls` support for invalid URLs"
"description":"Added support for `--pending-deprecation`."
}
]
},
"desc":"<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p><code>process.binding()</code> is for use by Node.js internal code only.</p>\n<p><a id=\"DEP0112\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The <code>dgram</code> module previously contained several APIs that were never meant to\naccessed outside of Node.js core: <code>Socket.prototype._handle</code>,\n<code>Socket.prototype._receiving</code>, <code>Socket.prototype._bindState</code>,\n<code>Socket.prototype._queue</code>, <code>Socket.prototype._reuseAddr</code>,\n<code>Socket.prototype._healthCheck()</code>, <code>Socket.prototype._stopReceiving()</code>, and\n<code>dgram._createSocketHandle()</code>.</p>\n<p><a id=\"DEP0113\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p><code>Cipher.setAuthTag()</code> and <code>Decipher.getAuthTag()</code> are no longer available. They\nwere never documented and would throw when called.</p>\n<p><a id=\"DEP0114\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>The <code>crypto._toBuf()</code> function was not designed to be used by modules outside\nof Node.js core and was removed.</p>\n<p><a id=\"DEP0115\"></a></p>",
"description":"Added documentation-only deprecation with `--pending-deprecation` support."
}
]
},
"desc":"<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>In recent versions of Node.js, there is no difference between\n<a href=\"crypto.html#crypto_crypto_randombytes_size_callback\"><code>crypto.randomBytes()</code></a> and <code>crypto.pseudoRandomBytes()</code>. The latter is\ndeprecated along with the undocumented aliases <code>crypto.prng()</code> and\n<code>crypto.rng()</code> in favor of <a href=\"crypto.html#crypto_crypto_randombytes_size_callback\"><code>crypto.randomBytes()</code></a> and may be removed in a\nfuture release.</p>\n<p><a id=\"DEP0116\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>The <a href=\"url.html#url_legacy_url_api\">Legacy URL API</a> is deprecated. This includes <a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a>,\n<a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a>, <a href=\"url.html#url_url_resolve_from_to\"><code>url.resolve()</code></a>, and the <a href=\"url.html#url_legacy_urlobject\">legacy <code>urlObject</code></a>. Please\nuse the <a href=\"url.html#url_the_whatwg_url_api\">WHATWG URL API</a> instead.</p>\n<p><a id=\"DEP0117\"></a></p>",
"desc":"<p>Type: End-of-Life</p>\n<p>Previous versions of Node.js exposed handles to internal native objects through\nthe <code>_handle</code> property of the <code>Cipher</code>, <code>Decipher</code>, <code>DiffieHellman</code>,\n<code>DiffieHellmanGroup</code>, <code>ECDH</code>, <code>Hash</code>, <code>Hmac</code>, <code>Sign</code>, and <code>Verify</code> classes.\nThe <code>_handle</code> property has been removed because improper use of the native\nobject can lead to crashing the application.</p>\n<p><a id=\"DEP0118\"></a></p>",
"type":"module",
"displayName":"DEP0117: Native crypto handles"
},
{
"textRaw":"DEP0118: `dns.lookup()` support for a falsy host name",
"desc":"<p>Type: Runtime</p>\n<p>Previous versions of Node.js supported <code>dns.lookup()</code> with a falsy host name\nlike <code>dns.lookup(false)</code> due to backward compatibility.\nThis behavior is undocumented and is thought to be unused in real world apps.\nIt will become an error in future versions of Node.js.</p>\n<p><a id=\"DEP0119\"></a></p>",
"type":"module",
"displayName":"DEP0118: `dns.lookup()` support for a falsy host name"
"desc":"<p>Type: End-of-Life</p>\n<p>Windows Performance Counter support has been removed from Node.js. The\nundocumented <code>COUNTER_NET_SERVER_CONNECTION()</code>,\n<code>COUNTER_NET_SERVER_CONNECTION_CLOSE()</code>, <code>COUNTER_HTTP_SERVER_REQUEST()</code>,\n<code>COUNTER_HTTP_SERVER_RESPONSE()</code>, <code>COUNTER_HTTP_CLIENT_REQUEST()</code>, and\n<code>COUNTER_HTTP_CLIENT_RESPONSE()</code> functions have been deprecated.</p>\n<p><a id=\"DEP0121\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The undocumented <code>net._setSimultaneousAccepts()</code> function was originally\nintended for debugging and performance tuning when using the <code>child_process</code>\nand <code>cluster</code> modules on Windows. The function is not generally useful and\nis being removed. See discussion here:\n<a href=\"https://github.com/nodejs/node/issues/18391\">https://github.com/nodejs/node/issues/18391</a></p>\n<p><a id=\"DEP0122\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>Setting the TLS ServerName to an IP address is not permitted by\n<a href=\"https://tools.ietf.org/html/rfc6066#section-3\">RFC 6066</a>. This will be ignored in a future version.</p>\n<p><a id=\"DEP0124\"></a></p>",
"type":"module",
"displayName":"DEP0123: setting the TLS ServerName to an IP address"
"desc":"<p>Type: Runtime</p>\n<p>The previously undocumented <code>timers.active()</code> is deprecated.\nPlease use the publicly documented <a href=\"timers.html#timers_timeout_refresh\"><code>timeout.refresh()</code></a> instead.\nIf re-referencing the timeout is necessary, <a href=\"timers.html#timers_timeout_ref\"><code>timeout.ref()</code></a> can be used\nwith no performance impact since Node.js 10.</p>\n<p><a id=\"DEP0127\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The previously undocumented and \"private\" <code>timers._unrefActive()</code> is deprecated.\nPlease use the publicly documented <a href=\"timers.html#timers_timeout_refresh\"><code>timeout.refresh()</code></a> instead.\nIf unreferencing the timeout is necessary, <a href=\"timers.html#timers_timeout_unref\"><code>timeout.unref()</code></a> can be used\nwith no performance impact since Node.js 10.</p>\n<p><a id=\"DEP0128\"></a></p>",
"type":"module",
"displayName":"DEP0127: `timers._unrefActive()`"
},
{
"textRaw":"DEP0128: modules with an invalid `main` entry and an `index.js` file",
"desc":"<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>Modules that have an invalid <code>main</code> entry (e.g., <code>./does-not-exist.js</code>) and\nalso have an <code>index.js</code> file in the top level directory will resolve the\n<code>index.js</code> file. That is deprecated and is going to throw an error in future\nNode.js versions.</p>\n<p><a id=\"DEP0129\"></a></p>",
"type":"module",
"displayName":"DEP0128: modules with an invalid `main` entry and an `index.js` file"
"desc":"<p>Type: Documentation-only</p>\n<p>The <code>_channel</code> property of child process objects returned by <code>spawn()</code> and\nsimilar functions is not intended for public use. Use <code>ChildProcess.channel</code>\ninstead.</p>\n<p><a id=\"DEP0130\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>Module.createRequireFromPath() is deprecated. Please use <a href=\"module.html#module_module_createrequire_filename\"><code>module.createRequire()</code></a> instead.</p>\n<p><a id=\"DEP0131\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>The legacy HTTP parser, used by default in versions of Node.js prior to 12.0.0,\nis deprecated. This deprecation applies to users of the\n<a href=\"cli.html#cli_http_parser_library\"><code>--http-parser=legacy</code></a> command-line flag.</p>\n<p><a id=\"DEP0132\"></a></p>",
"desc":"<p>Type: Runtime</p>\n<p>Passing a callback to <a href=\"worker_threads.html#worker_threads_worker_terminate\"><code>worker.terminate()</code></a> is deprecated. Use the returned\n<code>Promise</code> instead, or a listener to the worker’s <code>'exit'</code> event.</p>\n<p><a id=\"DEP0133\"></a></p>",
"type":"module",
"displayName":"DEP0132: `worker.terminate()` with callback"
"desc":"<p>Type: Documentation-only</p>\n<p><a href=\"http.html#http_response_finished\"><code>response.finished</code></a> indicates whether <a href=\"http.html#http_response_end_data_encoding_callback\"><code>response.end()</code></a> has been\ncalled, not whether <code>'finish'</code> has been emitted and the underlying data\nis flushed.</p>\n<p>Use <a href=\"http.html#http_response_writablefinished\"><code>response.writableFinished</code></a> or <a href=\"http.html#http_response_writableended\"><code>response.writableEnded</code></a>\naccordingly instead to avoid the ambigiuty.</p>\n<p>To maintain existing behaviour <code>response.finished</code> should be replaced with\n<code>response.writableEnded</code>.</p>\n<p><a id=\"DEP0139\"></a></p>",
"desc":"<p>Type: Documentation-only</p>\n<p>Calling <code>process.umask()</code> with no argument causes the process-wide umask to be\nwritten twice. This introduces a race condition between threads, and is a\npotential security vulnerability. There is no safe, cross-platform alternative\nAPI.</p>\n<p><a id=\"DEP0144\"></a></p>",
"type":"module",
"displayName":"DEP0139: `process.umask()` with no arguments"
"desc":"<p>Type: Documentation-only</p>\n<p>A CommonJS module can access the first module that required it using\n<code>module.parent</code>. This feature is deprecated because it does not work\nconsistently in the presence of ECMAScript modules and because it gives an\ninaccurate representation of the CommonJS module graph.</p>\n<p>Some modules use it to check if they are the entry point of the current process.\nInstead, it is recommended to compare <code>require.main</code> and <code>module</code>:</p>\n<pre><code class=\"language-js\">if (require.main === module) {\n // Code section that will run only if current file is the entry point.\n}\n</code></pre>\n<p>When looking for the CommonJS modules that have required the current one,\n<code>require.cache</code> and <code>module.children</code> can be used:</p>\n<pre><code class=\"language-js\">const moduleParents = Object.values(require.cache)\n .filter((m) => m.children.includes(module));\n</code></pre>",