From 5d8a107eb79bcb5aa46650997d6093c132ae2a49 Mon Sep 17 00:00:00 2001 From: jaexxin Date: Fri, 30 Aug 2024 09:43:37 +0900 Subject: [PATCH 1/4] doc: clarify Web Storage behavior --- doc/api/cli.md | 7 +++++++ doc/api/globals.md | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index ce34dee77ef300..49dbaa28063378 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3384,6 +3384,13 @@ for MiB in 16 32 64 128; do node --max-semi-space-size=$MiB index.js done ``` +### --localstorage-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` diff --git a/doc/api/globals.md b/doc/api/globals.md index a559004d7e3842..71b3411a820be4 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -1199,6 +1199,14 @@ 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. + [CommonJS module]: modules.md [CommonJS modules]: modules.md [ECMAScript module]: esm.md From 3fbf109a5a3c6829a4148224fa8455927c202d16 Mon Sep 17 00:00:00 2001 From: jaexxin Date: Fri, 30 Aug 2024 10:02:12 +0900 Subject: [PATCH 2/4] doc: clarify Web Storage behavior --- doc/api/cli.md | 8 ++++---- doc/api/globals.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 49dbaa28063378..686f7676c059d9 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3384,13 +3384,13 @@ for MiB in 16 32 64 128; do node --max-semi-space-size=$MiB index.js done ``` -### --localstorage-file -The --localstorage-file option specifies the file used for localStorage in Node.js. +### --localstorage-file -- 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. +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` diff --git a/doc/api/globals.md b/doc/api/globals.md index 71b3411a820be4..43debf0a7d04e3 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -1203,9 +1203,9 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. 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. +* 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. [CommonJS module]: modules.md [CommonJS modules]: modules.md From 641162334d582cfcd30f8b0a1d254a7ae3467e1b Mon Sep 17 00:00:00 2001 From: jaexxin Date: Fri, 30 Aug 2024 10:11:51 +0900 Subject: [PATCH 3/4] doc: clarify Web Storage behavior --- doc/api/cli.md | 3 ++- doc/api/globals.md | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 686f7676c059d9..a87ba10b53b872 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3389,7 +3389,8 @@ done 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. +* 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` diff --git a/doc/api/globals.md b/doc/api/globals.md index 43debf0a7d04e3..e3539008a5f2ac 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -1204,7 +1204,9 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. 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. +* `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. + cli.md * The storage quota for both localStorage and sessionStorage is 10MB per process. [CommonJS module]: modules.md From 8f323d5f69fcecf85165150e2afe286dcf45ef83 Mon Sep 17 00:00:00 2001 From: jaexxin Date: Fri, 30 Aug 2024 10:19:57 +0900 Subject: [PATCH 4/4] doc: clarify Web Storage behavior --- doc/api/cli.md | 7 ++++--- doc/api/globals.md | 14 +++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index a87ba10b53b872..45123ac284fde4 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3389,9 +3389,10 @@ done 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. +* 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` diff --git a/doc/api/globals.md b/doc/api/globals.md index e3539008a5f2ac..16538d7d6b70d0 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -1203,11 +1203,15 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. 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. - cli.md -* The storage quota for both localStorage and sessionStorage is 10MB per process. +* 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. [CommonJS module]: modules.md [CommonJS modules]: modules.md