Skip to content
Merged
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
27 changes: 17 additions & 10 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1745,10 +1745,11 @@
added: v22.4.0
-->

> Stability: 1.2 - Release candidate.

The file used to store `localStorage` data. If the file does not exist, it is
created the first time `localStorage` is accessed. The same file may be shared
between multiple Node.js processes concurrently. This flag is a no-op if
Node.js is started with the `--no-webstorage` (or `--no-experimental-webstorage`) flag.
between multiple Node.js processes concurrently.

### `--max-http-header-size=size`

Expand Down Expand Up @@ -1910,6 +1911,20 @@

Disable exposition of {WebSocket} on the global scope.

### `--no-experimental-webstorage`

<!-- YAML
added: v22.4.0
changes:
- version: v25.0.0
pr-url: https://github.com/nodejs/node/pull/57666

Check warning on line 1920 in doc/api/cli.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: The feature is now enabled by default.
-->

> Stability: 1.2 - Release candidate.

Disable [`Web Storage`][] support.

### `--no-extra-info-on-fatal-exception`

<!-- YAML
Expand Down Expand Up @@ -1977,14 +1992,6 @@

Silence all process warnings (including deprecations).

### `--no-webstorage`

<!-- YAML
added: v25.0.0
-->

Disable [`Web Storage`][] support.

### `--node-memory-debug`

<!-- YAML
Expand Down
32 changes: 25 additions & 7 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,28 @@

<!-- YAML
added: v22.4.0
-->
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/60351

Check warning on line 649 in doc/api/globals.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: Accessing the `localStorage` global without providing
`--localstorage-file` now throws a `DOMException`, for
compliance with the Web Storage specification.
- version: v25.0.0
pr-url: https://github.com/nodejs/node/pull/57666

Check warning on line 654 in doc/api/globals.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: When webstorage is enabled and `--localstorage-file` is not
provided, accessing the `localStorage` global now returns an
empty object.
- version: v25.0.0
pr-url: https://github.com/nodejs/node/pull/57666

Check warning on line 659 in doc/api/globals.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: This API is no longer behind `--experimental-webstorage` runtime flag.
-->

> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].

A browser-compatible implementation of [`localStorage`][]. Data is stored
unencrypted in the file specified by the [`--localstorage-file`][] CLI flag.
The maximum amount of data that can be stored is 10 MB.
Any modification of this data outside of the Web Storage API is not supported.
Disable this API with the [`--no-webstorage`][] (or its alias `--no-experimental-webstorage`) CLI flag.
`localStorage` data is not stored per user or per request when used in the context
of a server, it is shared across all users and requests.

Expand Down Expand Up @@ -1073,9 +1088,13 @@

<!-- YAML
added: v22.4.0
changes:
- version: v25.0.0
pr-url: https://github.com/nodejs/node/pull/57666

Check warning on line 1093 in doc/api/globals.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: This API is no longer behind `--experimental-webstorage` runtime flag.
-->

> Stability: 1.0 - Early development.
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].

A browser-compatible implementation of [`sessionStorage`][]. Data is stored in
memory, with a storage quota of 10 MB. `sessionStorage` data persists only within
Expand Down Expand Up @@ -1111,10 +1130,9 @@
added: v22.4.0
-->

> Stability: 1.0 - Early development.
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].

A browser-compatible implementation of {Storage}. Disable this API with the
[`--no-webstorage`][] (or its alias `--no-experimental-webstorage`) CLI flag.
A browser-compatible implementation of {Storage}.

## `structuredClone(value[, options])`

Expand Down Expand Up @@ -1328,7 +1346,7 @@
[`--localstorage-file`]: cli.md#--localstorage-filefile
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
[`--no-webstorage`]: cli.md#--no-webstorage
[`--no-experimental-webstorage`]: cli.md#--no-experimental-webstorage
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
[`CompressionStream`]: webstreams.md#class-compressionstream
[`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy
Expand Down
4 changes: 2 additions & 2 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ Enable experimental support for the EventSource Web API.
.It Fl -no-experimental-websocket
Disable experimental support for the WebSocket API.
.
.It Fl -no-webstorage
Disable webstorage.
.It Fl -no-experimental-webstorage
Disable experimental support for the Web Storage API.
.
.It Fl -no-experimental-repl-await
Disable top-level await keyword support in REPL.
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function setupQuic() {

function setupWebStorage() {
if (getEmbedderOptions().noBrowserGlobals ||
!getOptionValue('--webstorage')) {
!getOptionValue('--experimental-webstorage')) {
return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -567,12 +567,12 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
NoOp{},
#endif
kAllowedInEnvvar);
AddOption("--webstorage",
"Web Storage API",
AddOption("--experimental-webstorage",
"experimental Web Storage API",
&EnvironmentOptions::webstorage,
kAllowedInEnvvar,
true);
AddAlias("--experimental-webstorage", "--webstorage");
AddAlias("--webstorage", "--experimental-webstorage");
AddOption("--localstorage-file",
"file used to persist localStorage data",
&EnvironmentOptions::localstorage_file,
Expand Down
Loading