Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3387,10 +3387,12 @@ Any other value will result in colorized output being disabled.

<!-- YAML
added: v22.1.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/60971
description: This feature is no longer experimental.
-->

> Stability: 1.1 - Active Development
Enable the [module compile cache][] for the Node.js instance. See the documentation of
[module compile cache][] for details.

Expand Down
28 changes: 20 additions & 8 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ to disk when the Node.js instance is about to exit. This is subject to change. T
is flushed to disk in case the application wants to spawn other Node.js instances
and let them share the cache long before the parent exits.

The compile cache layout on disk is an implementation detail and should not be
relied upon. The compile cache generated is typically only reusable in the same
version of Node.js, and should be not assumed to be compatible across different
versions of Node.js.

### Portability of the compile cache

By default, caches are invalidated when the absolute paths of the modules being
Expand Down Expand Up @@ -449,10 +454,12 @@ separately if the same base directory is used to persist the cache, so they can

<!-- YAML
added: v22.8.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/60971
description: This feature is no longer experimental.
-->

> Stability: 1.1 - Active Development

The following constants are returned as the `status` field in the object returned by
[`module.enableCompileCache()`][] to indicate the result of the attempt to enable the
[module compile cache][].
Expand Down Expand Up @@ -503,6 +510,9 @@ The following constants are returned as the `status` field in the object returne
<!-- YAML
added: v22.8.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/60971
description: This feature is no longer experimental.
- version: v25.0.0
pr-url: https://github.com/nodejs/node/pull/58797
description: Add `portable` option to enable portable compile cache.
Expand All @@ -511,8 +521,6 @@ changes:
description: Rename the unreleased `path` option to `directory` to maintain consistency.
-->

> Stability: 1.1 - Active Development

* `options` {string|Object} Optional. If a string is passed, it is considered to be `options.directory`.
* `directory` {string} Optional. Directory to store the compile cache. If not specified,
the directory specified by the [`NODE_COMPILE_CACHE=dir`][] environment variable
Expand Down Expand Up @@ -557,10 +565,12 @@ be inherited into the child workers. The directory can be obtained either from t
added:
- v23.0.0
- v22.10.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/60971
description: This feature is no longer experimental.
-->

> Stability: 1.1 - Active Development

Flush the [module compile cache][] accumulated from modules already loaded
in the current Node.js instance to disk. This returns after all the flushing
file system operations come to an end, no matter they succeed or not. If there
Expand All @@ -571,10 +581,12 @@ interfere with the actual operation of the application.

<!-- YAML
added: v22.8.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/60971
description: This feature is no longer experimental.
-->

> Stability: 1.1 - Active Development

* Returns: {string|undefined} Path to the [module compile cache][] directory if it is enabled,
or `undefined` otherwise.

Expand Down
Loading