Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify Web Storage behavior #54652

Closed
wants to merge 4 commits into from
Closed
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
9 changes: 9 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3385,6 +3385,15 @@ for MiB in 16 32 64 128; do
done
```

### --localstorage-file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this entry already exists somewhere else in the file.


The --localstorage-file option specifies the file used for localStorage in Node.js.

* This file can be accessed by multiple processes simultaneously, which
might require implementing file locking or other synchronization
mechanisms to ensure data integrity.
* The storage quota for `localStorage` is 10MB per process.

### `--security-revert`

### `--stack-trace-limit=limit`
Expand Down
14 changes: 14 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,20 @@ added: v18.0.0

A browser-compatible implementation of [`WritableStreamDefaultWriter`][].

## Web Storage API

In Node.js, the localStorage and sessionStorage objects function differently compared to browsers or Deno:

* Both `localStorage` and `sessionStorage` are scoped to the current process,
not individual users or server requests. This is crucial for applications
like server-side rendering.
* `localStorage` uses the value of the `--localstorage-file` flag as its
origin. This file can be accessed simultaneously by multiple processes,
which may require implementing file locking or other synchronization
mechanisms to ensure data integrity.
* The storage quota for both `localStorage` and `sessionStorage` is
10MB per process.
Comment on lines +1202 to +1214
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this information is already present in this file under localStorage and sessionStorage


[CommonJS module]: modules.md
[CommonJS modules]: modules.md
[ECMAScript module]: esm.md
Expand Down
Loading