-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Conversation
## 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. |
There was a problem hiding this comment.
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
@@ -3385,6 +3385,15 @@ for MiB in 16 32 64 128; do | |||
done | |||
``` | |||
|
|||
### --localstorage-file |
There was a problem hiding this comment.
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.
Possible duplicate of #53881 |
Title:
doc: clarify Web Storage behavior and document --localstorage-file option
Description:
Issue Resolved
This pull request addresses the issue outlined in #53871. The changes clarify the Web Storage behavior in Node.js and document the
--localstorage-file
option.Changes Made
cli.md
: Added documentation for the--localstorage-file
option.--max-old-space-size
section.--localstorage-file
option to specify the file used forlocalStorage
in Node.js.Example documentation snippet added:
globals.md
: Added a new section describing howlocalStorage
andsessionStorage
behave in Node.js.--localstorage-file
flag determines the file used forlocalStorage
.Example documentation snippet added:
Note
--localstorage-file
option is currently documented but not implemented in the Node.js core. Therefore, the added documentation is primarily for reference and future-proofing.Please review the documentation updates, and let me know if there are any additional changes or clarifications needed.