@@ -11,7 +11,7 @@ added: REPLACEME
1111<!-- source_link=lib/vfs.js -->
1212
1313The ` node:vfs ` module provides a virtual file system that can be mounted
14- alongside the real file system. Virtual files can be read using standard ` fs `
14+ alongside the real file system. Virtual files can be read using standard ` node: fs`
1515operations and loaded as modules using ` require() ` or ` import ` .
1616
1717To access it:
@@ -29,7 +29,7 @@ This module is only available under the `node:` scheme.
2929## Overview
3030
3131The Virtual File System (VFS) allows you to create in-memory file systems that
32- integrate seamlessly with the Node.js ` fs ` module and module loading system. This
32+ integrate seamlessly with the Node.js ` node: fs` module and module loading system. This
3333is useful for:
3434
3535* Bundling assets in Single Executable Applications (SEA)
@@ -75,7 +75,7 @@ See [Security considerations][] for important warnings about overlay mode.
7575## Basic usage
7676
7777The following example shows how to create a virtual file system, add files,
78- and access them through the standard ` fs ` API:
78+ and access them through the standard ` node: fs` API:
7979
8080``` mjs
8181import vfs from ' node:vfs' ;
@@ -155,7 +155,7 @@ Each worker thread has its own independent VFS state. A VFS mounted in the
155155main thread is not automatically available in worker threads. To use VFS in
156156workers, create and mount a new VFS instance within each worker.
157157
158- ### fs.watch limitations
158+ ### ` fs.watch ` limitations
159159
160160The ` fs.watch() ` and ` fs.watchFile() ` functions work with VFS files but use
161161polling internally rather than native file system notifications, since VFS
@@ -226,7 +226,7 @@ added: REPLACEME
226226
227227The ` VirtualFileSystem ` class provides a file system interface backed by a
228228provider. It supports standard file system operations and can be mounted to
229- make virtual files accessible through the ` fs ` module.
229+ make virtual files accessible through the ` node: fs` module.
230230
231231### ` new VirtualFileSystem([provider][, options]) `
232232
@@ -288,7 +288,7 @@ added: REPLACEME
288288* Returns: {VirtualFileSystem} The VFS instance (for chaining or ` using ` ).
289289
290290Mounts the virtual file system at the specified path prefix. After mounting,
291- files in the VFS can be accessed via the ` fs ` module using paths that start
291+ files in the VFS can be accessed via the ` node: fs` module using paths that start
292292with the prefix.
293293
294294If a real file system path already exists at the mount prefix, the VFS
@@ -410,7 +410,7 @@ added: REPLACEME
410410-->
411411
412412Unmounts the virtual file system. After unmounting, virtual files are no longer
413- accessible through the ` fs ` module. The VFS can be remounted at the same or a
413+ accessible through the ` node: fs` module. The VFS can be remounted at the same or a
414414different path by calling ` mount() ` again. Unmounting also resets the virtual
415415working directory if one was set.
416416
@@ -419,15 +419,15 @@ has no effect.
419419
420420### File System Methods
421421
422- The ` VirtualFileSystem ` class provides methods that mirror the ` fs ` module API.
422+ The ` VirtualFileSystem ` class provides methods that mirror the ` node: fs` module API.
423423All paths are relative to the VFS root (not the mount point).
424424
425- These methods accept the same argument types as their ` fs ` counterparts,
425+ These methods accept the same argument types as their ` node: fs` counterparts,
426426including ` string ` , ` Buffer ` , ` TypedArray ` , and ` DataView ` where applicable.
427427
428428#### Overlay mode behavior
429429
430- When overlay mode is enabled, the following behavior applies to ` fs ` operations
430+ When overlay mode is enabled, the following behavior applies to ` node: fs` operations
431431on mounted paths.
432432
433433** Path encoding:** The VFS uses UTF-8 encoding for file and directory names
@@ -465,11 +465,11 @@ before VFS operations.
465465
466466#### Synchronous Methods
467467
468- The ` VirtualFileSystem ` class supports all common synchronous ` fs ` methods
468+ The ` VirtualFileSystem ` class supports all common synchronous ` node: fs` methods
469469for reading, writing, and managing files and directories. Methods mirror the
470- ` fs ` module API.
470+ ` node: fs` module API.
471471
472- The following ` fs ` sync methods have ** no** VFS equivalent:
472+ The following ` node: fs` sync methods have ** no** VFS equivalent:
473473
474474* ` chmodSync() ` / ` fchmodSync() ` - VFS does not support permission changes
475475* ` chownSync() ` / ` fchownSync() ` - VFS does not support ownership changes
@@ -515,9 +515,7 @@ added: REPLACEME
515515The ` VirtualProvider ` class is an abstract base class for VFS providers.
516516Providers implement the actual file system storage and operations.
517517
518- ### Properties
519-
520- #### ` provider.readonly `
518+ ### ` provider.readonly `
521519
522520<!-- YAML
523521added: REPLACEME
@@ -691,9 +689,9 @@ added: REPLACEME
691689
692690The real file system path that this provider wraps.
693691
694- ## Integration with ` fs ` module
692+ ## Integration with ` node: fs` module
695693
696- When a VFS is mounted, the standard ` fs ` module automatically routes operations
694+ When a VFS is mounted, the standard ` node: fs` module automatically routes operations
697695to the VFS for paths that match the mount prefix:
698696
699697``` mjs
@@ -765,10 +763,10 @@ console.log(greet('World')); // Hello, World!
765763
766764## Implementation details
767765
768- ### Stats objects
766+ ### ` Stats ` objects
769767
770- The VFS returns real ` fs.Stats ` objects from ` stat() ` , ` lstat() ` , and ` fstat() `
771- operations. These Stats objects behave identically to those returned by the real
768+ The VFS returns real { fs.Stats} objects from ` stat() ` , ` lstat() ` , and ` fstat() `
769+ operations. These ` Stats ` objects behave identically to those returned by the real
772770file system:
773771
774772* ` stats.isFile() ` , ` stats.isDirectory() ` , ` stats.isSymbolicLink() ` work correctly
@@ -955,13 +953,13 @@ fs.readFileSync('/etc/shadow'); // Returns 'intercepted!' (mocked)
955953
956954This is particularly dangerous because:
957955
958- * It's harder to detect than full path shadowing
959- * Only specific targeted files are affected
960- * Other operations appear to work normally
956+ * It is harder to detect than full path shadowing.
957+ * Only specific targeted files are affected.
958+ * Other operations appear to work normally.
961959
962960### Monitoring VFS mounts
963961
964- To help detect unauthorized VFS usage, the ` process ` object emits events when
962+ To help detect unauthorized VFS usage, ` node: process` emits events when
965963a VFS is mounted or unmounted:
966964
967965``` cjs
0 commit comments