{
  "type": "module",
  "source": "doc/api/fs.md",
  "modules": [
    {
      "textRaw": "File system",
      "name": "file_system",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:fs</code> module enables interacting with the file system in a\nway modeled on standard POSIX functions.</p>\n<p>To use the promise-based APIs:</p>\n<pre><code class=\"language-mjs\">import * as fs from 'node:fs/promises';\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs/promises');\n</code></pre>\n<p>To use the callback and sync APIs:</p>\n<pre><code class=\"language-mjs\">import * as fs from 'node:fs';\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs');\n</code></pre>\n<p>All file system operations have synchronous, callback, and promise-based\nforms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).</p>",
      "modules": [
        {
          "textRaw": "Promise example",
          "name": "promise_example",
          "type": "module",
          "desc": "<p>Promise-based operations return a promise that is fulfilled when the\nasynchronous operation is complete.</p>\n<pre><code class=\"language-mjs\">import { unlink } from 'node:fs/promises';\n\ntry {\n  await unlink('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (error) {\n  console.error('there was an error:', error.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { unlink } = require('node:fs/promises');\n\n(async function(path) {\n  try {\n    await unlink(path);\n    console.log(`successfully deleted ${path}`);\n  } catch (error) {\n    console.error('there was an error:', error.message);\n  }\n})('/tmp/hello');\n</code></pre>",
          "displayName": "Promise example"
        },
        {
          "textRaw": "Callback example",
          "name": "callback_example",
          "type": "module",
          "desc": "<p>The callback form takes a completion callback function as its last\nargument and invokes the operation asynchronously. The arguments passed to\nthe completion callback depend on the method, but the first argument is always\nreserved for an exception. If the operation is completed successfully, then\nthe first argument is <code>null</code> or <code>undefined</code>.</p>\n<pre><code class=\"language-mjs\">import { unlink } from 'node:fs';\n\nunlink('/tmp/hello', (err) => {\n  if (err) throw err;\n  console.log('successfully deleted /tmp/hello');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { unlink } = require('node:fs');\n\nunlink('/tmp/hello', (err) => {\n  if (err) throw err;\n  console.log('successfully deleted /tmp/hello');\n});\n</code></pre>\n<p>The callback-based versions of the <code>node:fs</code> module APIs are preferable over\nthe use of the promise APIs when maximal performance (both in terms of\nexecution time and memory allocation) is required.</p>",
          "displayName": "Callback example"
        },
        {
          "textRaw": "Synchronous example",
          "name": "synchronous_example",
          "type": "module",
          "desc": "<p>The synchronous APIs block the Node.js event loop and further JavaScript\nexecution until the operation is complete. Exceptions are thrown immediately\nand can be handled using <code>try…catch</code>, or can be allowed to bubble up.</p>\n<pre><code class=\"language-mjs\">import { unlinkSync } from 'node:fs';\n\ntry {\n  unlinkSync('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (err) {\n  // handle the error\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { unlinkSync } = require('node:fs');\n\ntry {\n  unlinkSync('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (err) {\n  // handle the error\n}\n</code></pre>",
          "displayName": "Synchronous example"
        },
        {
          "textRaw": "Promises API",
          "name": "promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": [
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/31553",
                "description": "Exposed as `require('fs/promises')`."
              },
              {
                "version": [
                  "v11.14.0",
                  "v10.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/26581",
                "description": "This API is no longer experimental."
              },
              {
                "version": "v10.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/20504",
                "description": "The API is accessible via `require('fs').promises` only."
              }
            ]
          },
          "desc": "<p>The <code>fs/promises</code> API provides asynchronous file system methods that return\npromises.</p>\n<p>The promise APIs use the underlying Node.js threadpool to perform file\nsystem operations off the event loop thread. These operations are not\nsynchronized or threadsafe. Care must be taken when performing multiple\nconcurrent modifications on the same file or data corruption may occur.</p>",
          "classes": [
            {
              "textRaw": "Class: `FileHandle`",
              "name": "FileHandle",
              "type": "class",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> object is an object wrapper for a numeric file descriptor.</p>\n<p>Instances of the <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> object are created by the <code>fsPromises.open()</code>\nmethod.</p>\n<p>All <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> objects are <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a>s.</p>\n<p>If a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> is not closed using the <code>filehandle.close()</code> method, it will\ntry to automatically close the file descriptor and emit a process warning,\nhelping to prevent memory leaks. Please do not rely on this behavior because\nit can be unreliable and the file may not be closed. Instead, always explicitly\nclose <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>s. Node.js may change this behavior in the future.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v15.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'close'</code> event is emitted when the <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has been closed and can no\nlonger be used.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`filehandle.appendFile(data[, options])`",
                  "name": "appendFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v21.1.0",
                          "v20.10.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50095",
                        "description": "The `flush` option is now supported."
                      },
                      {
                        "version": [
                          "v15.14.0",
                          "v14.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/37490",
                        "description": "The `data` argument supports `AsyncIterable`, `Iterable`, and `Stream`."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|TypedArray|DataView|AsyncIterable|Stream}",
                          "name": "data",
                          "type": "string|Buffer|TypedArray|DataView|AsyncIterable|Stream"
                        },
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`'utf8'`"
                            },
                            {
                              "textRaw": "`signal` {AbortSignal|undefined} allows aborting an in-progress writeFile. **Default:** `undefined`",
                              "name": "signal",
                              "type": "AbortSignal|undefined",
                              "default": "`undefined`",
                              "desc": "allows aborting an in-progress writeFile."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Alias of <a href=\"#filehandlewritefiledata-options\"><code>filehandle.writeFile()</code></a>.</p>\n<p>When operating on file handles, the mode cannot be changed from what it was set\nto with <a href=\"#fspromisesopenpath-flags-mode\"><code>fsPromises.open()</code></a>. Therefore, this is equivalent to\n<a href=\"#filehandlewritefiledata-options\"><code>filehandle.writeFile()</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.chmod(mode)`",
                  "name": "chmod",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`mode` {integer} the file mode bit mask.",
                          "name": "mode",
                          "type": "integer",
                          "desc": "the file mode bit mask."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Modifies the permissions on the file. See <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.chown(uid, gid)`",
                  "name": "chown",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`uid` {integer} The file's new owner's user id.",
                          "name": "uid",
                          "type": "integer",
                          "desc": "The file's new owner's user id."
                        },
                        {
                          "textRaw": "`gid` {integer} The file's new group's group id.",
                          "name": "gid",
                          "type": "integer",
                          "desc": "The file's new group's group id."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Changes the ownership of the file. A wrapper for <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Closes the file handle after waiting for any pending operation on the handle to\ncomplete.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet filehandle;\ntry {\n  filehandle = await open('thefile.txt', 'r');\n} finally {\n  await filehandle?.close();\n}\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.createReadStream([options])`",
                  "name": "createReadStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`encoding` {string} **Default:** `null`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`null`"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} **Default:** `true`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`emitClose` {boolean} **Default:** `true`",
                              "name": "emitClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`start` {integer}",
                              "name": "start",
                              "type": "integer"
                            },
                            {
                              "textRaw": "`end` {integer} **Default:** `Infinity`",
                              "name": "end",
                              "type": "integer",
                              "default": "`Infinity`"
                            },
                            {
                              "textRaw": "`highWaterMark` {integer} **Default:** `64 * 1024`",
                              "name": "highWaterMark",
                              "type": "integer",
                              "default": "`64 * 1024`"
                            },
                            {
                              "textRaw": "`signal` {AbortSignal|undefined} **Default:** `undefined`",
                              "name": "signal",
                              "type": "AbortSignal|undefined",
                              "default": "`undefined`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {fs.ReadStream}",
                        "name": "return",
                        "type": "fs.ReadStream"
                      }
                    }
                  ],
                  "desc": "<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart counting at 0, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. If <code>start</code> is\nomitted or <code>undefined</code>, <code>filehandle.createReadStream()</code> reads sequentially from\nthe current file position. The <code>encoding</code> can be any one of those accepted by\n<a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If the <code>FileHandle</code> points to a character device that only supports blocking\nreads (such as keyboard or sound card), read operations do not finish until data\nis available. This can prevent the process from exiting and the stream from\nclosing naturally.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nconst fd = await open('/dev/input/event0');\n// Create a stream from some character device.\nconst stream = fd.createReadStream();\nsetTimeout(() => {\n  stream.close(); // This may not close the stream.\n  // Artificially marking end-of-stream, as if the underlying resource had\n  // indicated end-of-file by itself, allows the stream to close.\n  // This does not cancel pending read operations, and if there is such an\n  // operation, the process may still not be able to exit successfully\n  // until it finishes.\n  stream.push(null);\n  stream.read(0);\n}, 100);\n</code></pre>\n<p>If <code>autoClose</code> is false, then the file descriptor won't be closed, even if\nthere's an error. It is the application's responsibility to close it and make\nsure there's no file descriptor leak. If <code>autoClose</code> is set to true (default\nbehavior), on <code>'error'</code> or <code>'end'</code> the file descriptor will be closed\nautomatically.</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nconst fd = await open('sample.txt');\nfd.createReadStream({ start: 90, end: 99 });\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.createWriteStream([options])`",
                  "name": "createWriteStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.11.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v21.0.0",
                          "v20.10.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50093",
                        "description": "The `flush` option is now supported."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`'utf8'`"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} **Default:** `true`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`emitClose` {boolean} **Default:** `true`",
                              "name": "emitClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`start` {integer}",
                              "name": "start",
                              "type": "integer"
                            },
                            {
                              "textRaw": "`highWaterMark` {number} **Default:** `16384`",
                              "name": "highWaterMark",
                              "type": "number",
                              "default": "`16384`"
                            },
                            {
                              "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                              "name": "flush",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {fs.WriteStream}",
                        "name": "return",
                        "type": "fs.WriteStream"
                      }
                    }
                  ],
                  "desc": "<p><code>options</code> may also include a <code>start</code> option to allow writing data at some\nposition past the beginning of the file, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. Modifying a file rather than\nreplacing it may require the <code>flags</code> <code>open</code> option to be set to <code>r+</code> rather than\nthe default <code>r</code>. The <code>encoding</code> can be any one of those accepted by <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>autoClose</code> is set to true (default behavior) on <code>'error'</code> or <code>'finish'</code>\nthe file descriptor will be closed automatically. If <code>autoClose</code> is false,\nthen the file descriptor won't be closed, even if there's an error.\nIt is the application's responsibility to close it and make sure there's no\nfile descriptor leak.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>"
                },
                {
                  "textRaw": "`filehandle.datasync()`",
                  "name": "datasync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Forces all currently queued I/O operations associated with the file to the\noperating system's synchronized I/O completion state. Refer to the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a> documentation for details.</p>\n<p>Unlike <code>filehandle.sync</code> this method does not flush modified metadata.</p>"
                },
                {
                  "textRaw": "`filehandle.pull([...transforms][, options])`",
                  "name": "pull",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`...transforms` {Function|Object} Optional transforms to apply via `stream/iter pull()`.",
                          "name": "...transforms",
                          "type": "Function|Object",
                          "desc": "Optional transforms to apply via `stream/iter pull()`.",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal}",
                              "name": "signal",
                              "type": "AbortSignal"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} Close the file handle when the stream ends. **Default:** `false`.",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Close the file handle when the stream ends."
                            },
                            {
                              "textRaw": "`start` {number} Byte offset to begin reading from. When specified, reads use explicit positioning (`pread` semantics). **Default:** current file position.",
                              "name": "start",
                              "type": "number",
                              "default": "current file position",
                              "desc": "Byte offset to begin reading from. When specified, reads use explicit positioning (`pread` semantics)."
                            },
                            {
                              "textRaw": "`limit` {number} Maximum number of bytes to read before ending the iterator. Reads stop when `limit` bytes have been delivered or EOF is reached, whichever comes first. **Default:** read until EOF.",
                              "name": "limit",
                              "type": "number",
                              "default": "read until EOF",
                              "desc": "Maximum number of bytes to read before ending the iterator. Reads stop when `limit` bytes have been delivered or EOF is reached, whichever comes first."
                            },
                            {
                              "textRaw": "`chunkSize` {number} Size in bytes of the buffer allocated for each read operation. **Default:** `131072` (128 KB).",
                              "name": "chunkSize",
                              "type": "number",
                              "default": "`131072` (128 KB)",
                              "desc": "Size in bytes of the buffer allocated for each read operation."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {AsyncIterable<Uint8Array[]>}",
                        "name": "return",
                        "type": "AsyncIterable<Uint8Array[]>"
                      }
                    }
                  ],
                  "desc": "<p>Return the file contents as an async iterable using the\n<a href=\"stream_iter.html\"><code>node:stream/iter</code></a> pull model. Reads are performed in <code>chunkSize</code>-byte\nchunks (default 128 KB). If transforms are provided, they are applied\nvia <a href=\"stream_iter.html#pullsource-transforms-options\"><code>stream/iter pull()</code></a>.</p>\n<p>The file handle is locked while the iterable is being consumed and unlocked\nwhen iteration completes, an error occurs, or the consumer breaks.</p>\n<p>This function is only available when the <code>--experimental-stream-iter</code> flag is\nenabled.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { text } from 'node:stream/iter';\nimport { compressGzip } from 'node:zlib/iter';\n\nconst fh = await open('input.txt', 'r');\n\n// Read as text\nconsole.log(await text(fh.pull({ autoClose: true })));\n\n// Read 1 KB starting at byte 100\nconst fh2 = await open('input.txt', 'r');\nconsole.log(await text(fh2.pull({ start: 100, limit: 1024, autoClose: true })));\n\n// Read with compression\nconst fh3 = await open('input.txt', 'r');\nconst compressed = fh3.pull(compressGzip(), { autoClose: true });\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { text } = require('node:stream/iter');\nconst { compressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  const fh = await open('input.txt', 'r');\n\n  // Read as text\n  console.log(await text(fh.pull({ autoClose: true })));\n\n  // Read 1 KB starting at byte 100\n  const fh2 = await open('input.txt', 'r');\n  console.log(await text(fh2.pull({ start: 100, limit: 1024, autoClose: true })));\n\n  // Read with compression\n  const fh3 = await open('input.txt', 'r');\n  const compressed = fh3.pull(compressGzip(), { autoClose: true });\n}\n\nrun().catch(console.error);\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.pullSync([...transforms][, options])`",
                  "name": "pullSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`...transforms` {Function|Object} Optional transforms to apply via `stream/iter pullSync()`.",
                          "name": "...transforms",
                          "type": "Function|Object",
                          "desc": "Optional transforms to apply via `stream/iter pullSync()`.",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`autoClose` {boolean} Close the file handle when the stream ends. **Default:** `false`.",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Close the file handle when the stream ends."
                            },
                            {
                              "textRaw": "`start` {number} Byte offset to begin reading from. When specified, reads use explicit positioning. **Default:** current file position.",
                              "name": "start",
                              "type": "number",
                              "default": "current file position",
                              "desc": "Byte offset to begin reading from. When specified, reads use explicit positioning."
                            },
                            {
                              "textRaw": "`limit` {number} Maximum number of bytes to read before ending the iterator. **Default:** read until EOF.",
                              "name": "limit",
                              "type": "number",
                              "default": "read until EOF",
                              "desc": "Maximum number of bytes to read before ending the iterator."
                            },
                            {
                              "textRaw": "`chunkSize` {number} Size in bytes of the buffer allocated for each read operation. **Default:** `131072` (128 KB).",
                              "name": "chunkSize",
                              "type": "number",
                              "default": "`131072` (128 KB)",
                              "desc": "Size in bytes of the buffer allocated for each read operation."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Iterable<Uint8Array[]>}",
                        "name": "return",
                        "type": "Iterable<Uint8Array[]>"
                      }
                    }
                  ],
                  "desc": "<p>Synchronous counterpart of <a href=\"#filehandlepulltransforms-options\"><code>filehandle.pull()</code></a>. Returns a sync iterable\nthat reads the file using synchronous I/O on the main thread. Reads are\nperformed in <code>chunkSize</code>-byte chunks (default 128 KB).</p>\n<p>The file handle is locked while the iterable is being consumed. Unlike the\nasync <code>pull()</code>, this method does not support <code>AbortSignal</code> since all\noperations are synchronous.</p>\n<p>This function is only available when the <code>--experimental-stream-iter</code> flag is\nenabled.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { textSync, pipeToSync } from 'node:stream/iter';\nimport { compressGzipSync, decompressGzipSync } from 'node:zlib/iter';\n\nconst fh = await open('input.txt', 'r');\n\n// Read as text (sync)\nconsole.log(textSync(fh.pullSync({ autoClose: true })));\n\n// Sync compress pipeline: file -> gzip -> file\nconst src = await open('input.txt', 'r');\nconst dst = await open('output.gz', 'w');\npipeToSync(src.pullSync(compressGzipSync(), { autoClose: true }), dst.writer({ autoClose: true }));\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { textSync, pipeToSync } = require('node:stream/iter');\nconst { compressGzipSync, decompressGzipSync } = require('node:zlib/iter');\n\nasync function run() {\n  const fh = await open('input.txt', 'r');\n\n  // Read as text (sync)\n  console.log(textSync(fh.pullSync({ autoClose: true })));\n\n  // Sync compress pipeline: file -> gzip -> file\n  const src = await open('input.txt', 'r');\n  const dst = await open('output.gz', 'w');\n  pipeToSync(\n    src.pullSync(compressGzipSync(), { autoClose: true }),\n    dst.writer({ autoClose: true }),\n  );\n}\n\nrun().catch(console.error);\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.read(buffer, offset, length, position)`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v21.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42835",
                        "description": "Accepts bigint values as `position`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the file data read.",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "A buffer that will be filled with the file data read."
                        },
                        {
                          "textRaw": "`offset` {integer} The location in the buffer at which to start filling. **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "The location in the buffer at which to start filling."
                        },
                        {
                          "textRaw": "`length` {integer} The number of bytes to read. **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`",
                          "desc": "The number of bytes to read."
                        },
                        {
                          "textRaw": "`position` {integer|bigint|null} The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged. **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint|null",
                          "default": "`null`",
                          "desc": "The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success with an object with two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success with an object with two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} The number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "The number of bytes read"
                          },
                          {
                            "textRaw": "`buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument.",
                            "name": "buffer",
                            "type": "Buffer|TypedArray|DataView",
                            "desc": "A reference to the passed in `buffer` argument."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Reads data from the file and stores that in the given buffer.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>"
                },
                {
                  "textRaw": "`filehandle.read([options])`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "changes": [
                      {
                        "version": "v21.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42835",
                        "description": "Accepts bigint values as `position`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the file data read. **Default:** `Buffer.alloc(16384)`",
                              "name": "buffer",
                              "type": "Buffer|TypedArray|DataView",
                              "default": "`Buffer.alloc(16384)`",
                              "desc": "A buffer that will be filled with the file data read."
                            },
                            {
                              "textRaw": "`offset` {integer} The location in the buffer at which to start filling. **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`",
                              "desc": "The location in the buffer at which to start filling."
                            },
                            {
                              "textRaw": "`length` {integer} The number of bytes to read. **Default:** `buffer.byteLength - offset`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.byteLength - offset`",
                              "desc": "The number of bytes to read."
                            },
                            {
                              "textRaw": "`position` {integer|bigint|null} The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged. **Default:**: `null`",
                              "name": "position",
                              "type": "integer|bigint|null",
                              "default": ": `null`",
                              "desc": "The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success with an object with two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success with an object with two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} The number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "The number of bytes read"
                          },
                          {
                            "textRaw": "`buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument.",
                            "name": "buffer",
                            "type": "Buffer|TypedArray|DataView",
                            "desc": "A reference to the passed in `buffer` argument."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Reads data from the file and stores that in the given buffer.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>"
                },
                {
                  "textRaw": "`filehandle.read(buffer[, options])`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.2.0",
                      "v16.17.0"
                    ],
                    "changes": [
                      {
                        "version": "v21.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42835",
                        "description": "Accepts bigint values as `position`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the file data read.",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "A buffer that will be filled with the file data read."
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`offset` {integer} The location in the buffer at which to start filling. **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`",
                              "desc": "The location in the buffer at which to start filling."
                            },
                            {
                              "textRaw": "`length` {integer} The number of bytes to read. **Default:** `buffer.byteLength - offset`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.byteLength - offset`",
                              "desc": "The number of bytes to read."
                            },
                            {
                              "textRaw": "`position` {integer|bigint|null} The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged. **Default:**: `null`",
                              "name": "position",
                              "type": "integer|bigint|null",
                              "default": ": `null`",
                              "desc": "The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success with an object with two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success with an object with two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} The number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "The number of bytes read"
                          },
                          {
                            "textRaw": "`buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument.",
                            "name": "buffer",
                            "type": "Buffer|TypedArray|DataView",
                            "desc": "A reference to the passed in `buffer` argument."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Reads data from the file and stores that in the given buffer.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>"
                },
                {
                  "textRaw": "`filehandle.readableWebStream([options])`",
                  "name": "readableWebStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57513",
                        "description": "Marking the API stable."
                      },
                      {
                        "version": [
                          "v23.8.0",
                          "v22.15.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/55461",
                        "description": "Removed option to create a 'bytes' stream. Streams are now always 'bytes' streams."
                      },
                      {
                        "version": [
                          "v20.0.0",
                          "v18.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/46933",
                        "description": "Added option to create a 'bytes' stream."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`autoClose` {boolean} When true, causes the {FileHandle} to be closed when the stream is closed. **Default:** `false`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When true, causes the {FileHandle} to be closed when the stream is closed."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {ReadableStream}",
                        "name": "return",
                        "type": "ReadableStream"
                      }
                    }
                  ],
                  "desc": "<p>Returns a byte-oriented <code>ReadableStream</code> that may be used to read the file's\ncontents.</p>\n<p>An error will be thrown if this method is called more than once or is called\nafter the <code>FileHandle</code> is closed or closing.</p>\n<pre><code class=\"language-mjs\">import {\n  open,\n} from 'node:fs/promises';\n\nconst file = await open('./some/file/to/read');\n\nfor await (const chunk of file.readableWebStream())\n  console.log(chunk);\n\nawait file.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  open,\n} = require('node:fs/promises');\n\n(async () => {\n  const file = await open('./some/file/to/read');\n\n  for await (const chunk of file.readableWebStream())\n    console.log(chunk);\n\n  await file.close();\n})();\n</code></pre>\n<p>While the <code>ReadableStream</code> will read the file to completion, it will not\nclose the <code>FileHandle</code> automatically. User code must still call the\n<code>fileHandle.close()</code> method unless the <code>autoClose</code> option is set to <code>true</code>.</p>"
                },
                {
                  "textRaw": "`filehandle.readFile(options)`",
                  "name": "readFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} **Default:** `null`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`null`"
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} allows aborting an in-progress readFile",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "allows aborting an in-progress readFile"
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the data will be a string.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the data will be a string."
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>encoding</code>.</p>\n<p>The <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support reading.</p>\n<p>If one or more <code>filehandle.read()</code> calls are made on a file handle and then a\n<code>filehandle.readFile()</code> call is made, the data will be read from the current\nposition till the end of the file. It doesn't always read from the beginning\nof the file.</p>"
                },
                {
                  "textRaw": "`filehandle.readLines([options])`",
                  "name": "readLines",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`encoding` {string} **Default:** `null`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`null`"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} **Default:** `true`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`emitClose` {boolean} **Default:** `true`",
                              "name": "emitClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`start` {integer}",
                              "name": "start",
                              "type": "integer"
                            },
                            {
                              "textRaw": "`end` {integer} **Default:** `Infinity`",
                              "name": "end",
                              "type": "integer",
                              "default": "`Infinity`"
                            },
                            {
                              "textRaw": "`highWaterMark` {integer} **Default:** `64 * 1024`",
                              "name": "highWaterMark",
                              "type": "integer",
                              "default": "`64 * 1024`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {readline.InterfaceConstructor}",
                        "name": "return",
                        "type": "readline.InterfaceConstructor"
                      }
                    }
                  ],
                  "desc": "<p>Convenience method to create a <code>readline</code> interface and stream over the file.\nSee <a href=\"#filehandlecreatereadstreamoptions\"><code>filehandle.createReadStream()</code></a> for the options.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nconst file = await open('./some/file/to/read');\n\nfor await (const line of file.readLines()) {\n  console.log(line);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\n\n(async () => {\n  const file = await open('./some/file/to/read');\n\n  for await (const line of file.readLines()) {\n    console.log(line);\n  }\n})();\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.readv(buffers[, position])`",
                  "name": "readv",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffers` {Buffer[]|TypedArray[]|DataView[]}",
                          "name": "buffers",
                          "type": "Buffer[]|TypedArray[]|DataView[]"
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success an object containing two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success an object containing two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} the number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "the number of bytes read"
                          },
                          {
                            "textRaw": "`buffers` {Buffer[]|TypedArray[]|DataView[]} property containing a reference to the `buffers` input.",
                            "name": "buffers",
                            "type": "Buffer[]|TypedArray[]|DataView[]",
                            "desc": "property containing a reference to the `buffers` input."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Read from a file and write to an array of {ArrayBufferView}s</p>"
                },
                {
                  "textRaw": "`filehandle.stat([options])`",
                  "name": "stat",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v26.1.0",
                        "pr-url": "https://github.com/nodejs/node/pull/57775",
                        "description": "Now accepts an additional `signal` property to allow aborting the operation."
                      },
                      {
                        "version": "v10.5.0",
                        "pr-url": "https://github.com/nodejs/node/pull/20220",
                        "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                              "name": "bigint",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} An AbortSignal to cancel the operation. **Default:** `undefined`.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "default": "`undefined`",
                              "desc": "An AbortSignal to cancel the operation."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with an {fs.Stats} for the file.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with an {fs.Stats} for the file."
                      }
                    }
                  ]
                },
                {
                  "textRaw": "`filehandle.sync()`",
                  "name": "sync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Request that all data for the open file descriptor is flushed to the storage\ndevice. The specific implementation is operating system and device specific.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a> documentation for more detail.</p>"
                },
                {
                  "textRaw": "`filehandle.truncate(len)`",
                  "name": "truncate",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`len` {integer} **Default:** `0`",
                          "name": "len",
                          "type": "integer",
                          "default": "`0`"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Truncates the file.</p>\n<p>If the file was larger than <code>len</code> bytes, only the first <code>len</code> bytes will be\nretained in the file.</p>\n<p>The following example retains only the first four bytes of the file:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet filehandle = null;\ntry {\n  filehandle = await open('temp.txt', 'r+');\n  await filehandle.truncate(4);\n} finally {\n  await filehandle?.close();\n}\n</code></pre>\n<p>If the file previously was shorter than <code>len</code> bytes, it is extended, and the\nextended part is filled with null bytes (<code>'\\0'</code>):</p>\n<p>If <code>len</code> is negative then <code>0</code> will be used.</p>"
                },
                {
                  "textRaw": "`filehandle.utimes(atime, mtime)`",
                  "name": "utimes",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`atime` {number|string|Date}",
                          "name": "atime",
                          "type": "number|string|Date"
                        },
                        {
                          "textRaw": "`mtime` {number|string|Date}",
                          "name": "mtime",
                          "type": "number|string|Date"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Change the file system timestamps of the object referenced by the <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>\nthen fulfills the promise with no arguments upon success.</p>"
                },
                {
                  "textRaw": "`filehandle.write(buffer, offset[, length[, position]])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `buffer` parameter won't coerce unsupported input to buffers anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`offset` {integer} The start position from within `buffer` where the data to write begins.",
                          "name": "offset",
                          "type": "integer",
                          "desc": "The start position from within `buffer` where the data to write begins."
                        },
                        {
                          "textRaw": "`length` {integer} The number of bytes from `buffer` to write. **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`",
                          "desc": "The number of bytes from `buffer` to write.",
                          "optional": true
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write <code>buffer</code> to the file.</p>\n<p>The promise is fulfilled with an object containing two properties:</p>\n<ul>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> the number of bytes written</li>\n<li><code>buffer</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> a reference to the <code>buffer</code> written.</li>\n</ul>\n<p>It is unsafe to use <code>filehandle.write()</code> multiple times on the same file\nwithout waiting for the promise to be fulfilled (or rejected). For this\nscenario, use <a href=\"#filehandlecreatewritestreamoptions\"><code>filehandle.createWriteStream()</code></a>.</p>\n<p>On Linux, positional writes do not work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.write(buffer[, options])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.3.0",
                      "v16.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`offset` {integer} **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`"
                            },
                            {
                              "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.byteLength - offset`"
                            },
                            {
                              "textRaw": "`position` {integer|null} **Default:** `null`",
                              "name": "position",
                              "type": "integer|null",
                              "default": "`null`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write <code>buffer</code> to the file.</p>\n<p>Similar to the above <code>filehandle.write</code> function, this version takes an\noptional <code>options</code> object. If no <code>options</code> object is specified, it will\ndefault with the above values.</p>"
                },
                {
                  "textRaw": "`filehandle.write(string[, position[, encoding]])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `string` parameter won't coerce unsupported input to strings anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`string` {string}",
                          "name": "string",
                          "type": "string"
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data from `string` should be written. If `position` is not a `number` the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data from `string` should be written. If `position` is not a `number` the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail.",
                          "optional": true
                        },
                        {
                          "textRaw": "`encoding` {string} The expected string encoding. **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "The expected string encoding.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write <code>string</code> to the file. If <code>string</code> is not a string, the promise is\nrejected with an error.</p>\n<p>The promise is fulfilled with an object containing two properties:</p>\n<ul>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> the number of bytes written</li>\n<li><code>buffer</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> a reference to the <code>string</code> written.</li>\n</ul>\n<p>It is unsafe to use <code>filehandle.write()</code> multiple times on the same file\nwithout waiting for the promise to be fulfilled (or rejected). For this\nscenario, use <a href=\"#filehandlecreatewritestreamoptions\"><code>filehandle.createWriteStream()</code></a>.</p>\n<p>On Linux, positional writes do not work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.writeFile(data, options)`",
                  "name": "writeFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v15.14.0",
                          "v14.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/37490",
                        "description": "The `data` argument supports `AsyncIterable`, `Iterable`, and `Stream`."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|TypedArray|DataView|AsyncIterable|Stream}",
                          "name": "data",
                          "type": "string|Buffer|TypedArray|DataView|AsyncIterable|Stream"
                        },
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} The expected character encoding when `data` is a string. **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`'utf8'`",
                              "desc": "The expected character encoding when `data` is a string."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal|undefined} allows aborting an in-progress writeFile. **Default:** `undefined`",
                              "name": "signal",
                              "type": "AbortSignal|undefined",
                              "default": "`undefined`",
                              "desc": "allows aborting an in-progress writeFile."
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string, a buffer, an <a href=\"https://tc39.github.io/ecma262/#sec-asynciterable-interface\"><code>&#x3C;AsyncIterable></code></a>, or an {Iterable} object.\nThe promise is fulfilled with no arguments upon success.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>encoding</code>.</p>\n<p>The <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support writing.</p>\n<p>It is unsafe to use <code>filehandle.writeFile()</code> multiple times on the same file\nwithout waiting for the promise to be fulfilled (or rejected).</p>\n<p>If one or more <code>filehandle.write()</code> calls are made on a file handle and then a\n<code>filehandle.writeFile()</code> call is made, the data will be written from the\ncurrent position till the end of the file. It doesn't always write from the\nbeginning of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.writev(buffers[, position])`",
                  "name": "writev",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.9.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffers` {Buffer[]|TypedArray[]|DataView[]}",
                          "name": "buffers",
                          "type": "Buffer[]|TypedArray[]|DataView[]"
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current position. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current position.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write an array of {ArrayBufferView}s to the file.</p>\n<p>The promise is fulfilled with an object containing a two properties:</p>\n<ul>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> the number of bytes written</li>\n<li><code>buffers</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView[]></code></a> a reference to the <code>buffers</code>\ninput.</li>\n</ul>\n<p>It is unsafe to call <code>writev()</code> multiple times on the same file without waiting\nfor the promise to be fulfilled (or rejected).</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.writer([options])`",
                  "name": "writer",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`autoClose` {boolean} Close the file handle when the writer ends or fails. **Default:** `false`.",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Close the file handle when the writer ends or fails."
                            },
                            {
                              "textRaw": "`start` {number} Byte offset to start writing at. When specified, writes use explicit positioning. **Default:** current file position.",
                              "name": "start",
                              "type": "number",
                              "default": "current file position",
                              "desc": "Byte offset to start writing at. When specified, writes use explicit positioning."
                            },
                            {
                              "textRaw": "`limit` {number} Maximum number of bytes the writer will accept. Async writes (`write()`, `writev()`) that would exceed the limit reject with `ERR_OUT_OF_RANGE`. Sync writes (`writeSync()`, `writevSync()`) return `false`. **Default:** no limit.",
                              "name": "limit",
                              "type": "number",
                              "default": "no limit",
                              "desc": "Maximum number of bytes the writer will accept. Async writes (`write()`, `writev()`) that would exceed the limit reject with `ERR_OUT_OF_RANGE`. Sync writes (`writeSync()`, `writevSync()`) return `false`."
                            },
                            {
                              "textRaw": "`chunkSize` {number} Maximum chunk size in bytes for synchronous write operations. Writes larger than this threshold fall back to async I/O. Set this to match the reader's `chunkSize` for optimal `pipeTo()` performance. **Default:** `131072` (128 KB).",
                              "name": "chunkSize",
                              "type": "number",
                              "default": "`131072` (128 KB)",
                              "desc": "Maximum chunk size in bytes for synchronous write operations. Writes larger than this threshold fall back to async I/O. Set this to match the reader's `chunkSize` for optimal `pipeTo()` performance."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Object}`write(chunk[, options])` {Function} Returns {Promise}. Accepts `Uint8Array`, `Buffer`, or string (UTF-8 encoded).`chunk` {Buffer|TypedArray|DataView|string}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writev(chunks[, options])` {Function} Returns {Promise}. Uses scatter/gather I/O via a single `writev()` syscall. Accepts mixed `Uint8Array`/string arrays.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writeSync(chunk)` {Function} Returns {boolean}. Attempts a synchronous write. Returns `true` if the write succeeded, `false` if the caller should fall back to async `write()`. Returns `false` when: the writer is closed/errored, an async operation is in flight, the chunk exceeds `chunkSize`, or the write would exceed `limit`.`chunk` {Buffer|TypedArray|DataView|string}`writevSync(chunks)` {Function} Returns {boolean}. Synchronous batch write. Same fallback semantics as `writeSync()`.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`end([options])` {Function} Returns {Promise}, fulfills with the total number of bytes written. Idempotent: returns `totalBytesWritten` if already closed, returns the pending promise if already closing. Rejects if the writer is in an errored state.`options` {Object}`signal` {AbortSignal} If the signal is already aborted, `end()` rejects with `AbortError` and the writer remains open.`endSync()` {Function} Returns {number|number} total bytes written on success, `-1` if the writer is errored or an async operation is in flight. Idempotent when already closed.`fail(reason)` {Function} Puts the writer into a terminal error state. Synchronous. If the writer is already closed or errored, this is a no-op. If `autoClose` is true, closes the file handle synchronously.",
                        "name": "return",
                        "type": "Object",
                        "desc": "`write(chunk[, options])` {Function} Returns {Promise}. Accepts `Uint8Array`, `Buffer`, or string (UTF-8 encoded).`chunk` {Buffer|TypedArray|DataView|string}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writev(chunks[, options])` {Function} Returns {Promise}. Uses scatter/gather I/O via a single `writev()` syscall. Accepts mixed `Uint8Array`/string arrays.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writeSync(chunk)` {Function} Returns {boolean}. Attempts a synchronous write. Returns `true` if the write succeeded, `false` if the caller should fall back to async `write()`. Returns `false` when: the writer is closed/errored, an async operation is in flight, the chunk exceeds `chunkSize`, or the write would exceed `limit`.`chunk` {Buffer|TypedArray|DataView|string}`writevSync(chunks)` {Function} Returns {boolean}. Synchronous batch write. Same fallback semantics as `writeSync()`.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`end([options])` {Function} Returns {Promise}, fulfills with the total number of bytes written. Idempotent: returns `totalBytesWritten` if already closed, returns the pending promise if already closing. Rejects if the writer is in an errored state.`options` {Object}`signal` {AbortSignal} If the signal is already aborted, `end()` rejects with `AbortError` and the writer remains open.`endSync()` {Function} Returns {number|number} total bytes written on success, `-1` if the writer is errored or an async operation is in flight. Idempotent when already closed.`fail(reason)` {Function} Puts the writer into a terminal error state. Synchronous. If the writer is already closed or errored, this is a no-op. If `autoClose` is true, closes the file handle synchronously."
                      }
                    }
                  ],
                  "desc": "<p>Return a <a href=\"stream_iter.html\"><code>node:stream/iter</code></a> writer backed by this file handle.</p>\n<p>The writer supports both <code>Symbol.asyncDispose</code> and <code>Symbol.dispose</code>:</p>\n<ul>\n<li><code>await using w = fh.writer()</code> — if the writer is still open (no <code>end()</code>\ncalled), <code>asyncDispose</code> calls <code>fail()</code>. If <code>end()</code> is pending, it waits\nfor it to complete.</li>\n<li><code>using w = fh.writer()</code> — calls <code>fail()</code> unconditionally.</li>\n</ul>\n<p>The <code>writeSync()</code> and <code>writevSync()</code> methods enable the try-sync fast path\nused by <a href=\"stream_iter.html#pipetosource-transforms-writer\"><code>stream/iter pipeTo()</code></a>. When the reader's chunk size matches the\nwriter's <code>chunkSize</code>, all writes in a <code>pipeTo()</code> pipeline complete\nsynchronously with zero promise overhead.</p>\n<p>This function is only available when the <code>--experimental-stream-iter</code> flag is\nenabled.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { from, pipeTo } from 'node:stream/iter';\nimport { compressGzip } from 'node:zlib/iter';\n\n// Async pipeline\nconst fh = await open('output.gz', 'w');\nawait pipeTo(from('Hello!'), compressGzip(), fh.writer({ autoClose: true }));\n\n// Sync pipeline with limit\nconst src = await open('input.txt', 'r');\nconst dst = await open('output.txt', 'w');\nconst w = dst.writer({ limit: 1024 * 1024 }); // Max 1 MB\nawait pipeTo(src.pull({ autoClose: true }), w);\nawait w.end();\nawait dst.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { from, pipeTo } = require('node:stream/iter');\nconst { compressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  // Async pipeline\n  const fh = await open('output.gz', 'w');\n  await pipeTo(from('Hello!'), compressGzip(), fh.writer({ autoClose: true }));\n\n  // Sync pipeline with limit\n  const src = await open('input.txt', 'r');\n  const dst = await open('output.txt', 'w');\n  const w = dst.writer({ limit: 1024 * 1024 }); // Max 1 MB\n  await pipeTo(src.pull({ autoClose: true }), w);\n  await w.end();\n  await dst.close();\n}\n\nrun().catch(console.error);\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle[Symbol.asyncDispose]()`",
                  "name": "[Symbol.asyncDispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v20.4.0",
                      "v18.18.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>filehandle.close()</code> and returns a promise that fulfills when the\nfilehandle is closed.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number} The numeric file descriptor managed by the {FileHandle} object.",
                  "name": "fd",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "The numeric file descriptor managed by the {FileHandle} object."
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`fsPromises.access(path[, mode])`",
              "name": "access",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer} **Default:** `fs.constants.F_OK`",
                      "name": "mode",
                      "type": "integer",
                      "default": "`fs.constants.F_OK`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Tests a user's permissions for the file or directory specified by <code>path</code>.\nThe <code>mode</code> argument is an optional integer that specifies the accessibility\nchecks to be performed. <code>mode</code> should be either the value <code>fs.constants.F_OK</code>\nor a mask consisting of the bitwise OR of any of <code>fs.constants.R_OK</code>,\n<code>fs.constants.W_OK</code>, and <code>fs.constants.X_OK</code> (e.g.\n<code>fs.constants.W_OK | fs.constants.R_OK</code>). Check <a href=\"#file-access-constants\">File access constants</a> for\npossible values of <code>mode</code>.</p>\n<p>If the accessibility check is successful, the promise is fulfilled with no\nvalue. If any of the accessibility checks fail, the promise is rejected\nwith an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> object. The following example checks if the file <code>/etc/passwd</code> can be read and written by the current process.</p>\n<pre><code class=\"language-mjs\">import { access, constants } from 'node:fs/promises';\n\ntry {\n  await access('/etc/passwd', constants.R_OK | constants.W_OK);\n  console.log('can access');\n} catch {\n  console.error('cannot access');\n}\n</code></pre>\n<p>Using <code>fsPromises.access()</code> to check for the accessibility of a file before\ncalling <code>fsPromises.open()</code> is not recommended. Doing so introduces a race\ncondition, since other processes may change the file's state between the two\ncalls. Instead, user code should open/read/write the file directly and handle\nthe error raised if the file is not accessible.</p>"
            },
            {
              "textRaw": "`fsPromises.appendFile(path, data[, options])`",
              "name": "appendFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50095",
                    "description": "The `flush` option is now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|FileHandle} filename or {FileHandle}",
                      "name": "path",
                      "type": "string|Buffer|URL|FileHandle",
                      "desc": "filename or {FileHandle}"
                    },
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'a'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'a'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously append data to a file, creating the file if it does not yet\nexist. <code>data</code> can be a string or a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>encoding</code>.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<p>The <code>path</code> may be specified as a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> that has been opened\nfor appending (using <code>fsPromises.open()</code>).</p>"
            },
            {
              "textRaw": "`fsPromises.chmod(path, mode)`",
              "name": "chmod",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the permissions of a file.</p>"
            },
            {
              "textRaw": "`fsPromises.chown(path, uid, gid)`",
              "name": "chown",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the ownership of a file.</p>"
            },
            {
              "textRaw": "`fsPromises.copyFile(src, dest[, mode])`",
              "name": "copyFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27044",
                    "description": "Changed `flags` argument to `mode` and imposed stricter type validation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|Buffer|URL} source filename to copy",
                      "name": "src",
                      "type": "string|Buffer|URL",
                      "desc": "source filename to copy"
                    },
                    {
                      "textRaw": "`dest` {string|Buffer|URL} destination filename of the copy operation",
                      "name": "dest",
                      "type": "string|Buffer|URL",
                      "desc": "destination filename of the copy operation"
                    },
                    {
                      "textRaw": "`mode` {integer} Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) **Default:** `0`.",
                      "name": "mode",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)",
                      "options": [
                        {
                          "textRaw": "`fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already exists.",
                          "name": "fs.constants.COPYFILE_EXCL",
                          "desc": "The copy operation will fail if `dest` already exists."
                        },
                        {
                          "textRaw": "`fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used.",
                          "name": "fs.constants.COPYFILE_FICLONE",
                          "desc": "The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used."
                        },
                        {
                          "textRaw": "`fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail.",
                          "name": "fs.constants.COPYFILE_FICLONE_FORCE",
                          "desc": "The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists.</p>\n<p>No guarantees are made about the atomicity of the copy operation. If an\nerror occurs after the destination file has been opened for writing, an attempt\nwill be made to remove the destination.</p>\n<pre><code class=\"language-mjs\">import { copyFile, constants } from 'node:fs/promises';\n\ntry {\n  await copyFile('source.txt', 'destination.txt');\n  console.log('source.txt was copied to destination.txt');\n} catch {\n  console.error('The file could not be copied');\n}\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\ntry {\n  await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);\n  console.log('source.txt was copied to destination.txt');\n} catch {\n  console.error('The file could not be copied');\n}\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.cp(src, dest[, options])`",
              "name": "cp",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53127",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47084",
                    "description": "Accept an additional `mode` option to specify the copy behavior as the `mode` argument of `fs.copyFile()`."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41819",
                    "description": "Accepts an additional `verbatimSymlinks` option to specify whether to perform path resolution for symlinks."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|URL} source path to copy.",
                      "name": "src",
                      "type": "string|URL",
                      "desc": "source path to copy."
                    },
                    {
                      "textRaw": "`dest` {string|URL} destination path to copy to.",
                      "name": "dest",
                      "type": "string|URL",
                      "desc": "destination path to copy to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`dereference` {boolean} dereference symlinks. **Default:** `false`.",
                          "name": "dereference",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "dereference symlinks."
                        },
                        {
                          "textRaw": "`errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`.",
                          "name": "errorOnExist",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "when `force` is `false`, and the destination exists, throw an error."
                        },
                        {
                          "textRaw": "`filter` {Function} Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that resolves to `true` or `false` **Default:** `undefined`.",
                          "name": "filter",
                          "type": "Function",
                          "default": "`undefined`",
                          "desc": "Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that resolves to `true` or `false`",
                          "options": [
                            {
                              "textRaw": "`src` {string} source path to copy.",
                              "name": "src",
                              "type": "string",
                              "desc": "source path to copy."
                            },
                            {
                              "textRaw": "`dest` {string} destination path to copy to.",
                              "name": "dest",
                              "type": "string",
                              "desc": "destination path to copy to."
                            },
                            {
                              "textRaw": "Returns: {boolean|Promise} A value that is coercible to `boolean` or a `Promise` that fulfils with such value.",
                              "name": "return",
                              "type": "boolean|Promise",
                              "desc": "A value that is coercible to `boolean` or a `Promise` that fulfils with such value."
                            }
                          ]
                        },
                        {
                          "textRaw": "`force` {boolean} overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior. **Default:** `true`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior."
                        },
                        {
                          "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`. See `mode` flag of `fsPromises.copyFile()`.",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0`. See `mode` flag of `fsPromises.copyFile()`",
                          "desc": "modifiers for copy operation."
                        },
                        {
                          "textRaw": "`preserveTimestamps` {boolean} When `true` timestamps from `src` will be preserved. **Default:** `false`.",
                          "name": "preserveTimestamps",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` timestamps from `src` will be preserved."
                        },
                        {
                          "textRaw": "`recursive` {boolean} copy directories recursively **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "copy directories recursively"
                        },
                        {
                          "textRaw": "`verbatimSymlinks` {boolean} When `true`, path resolution for symlinks will be skipped. **Default:** `false`",
                          "name": "verbatimSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, path resolution for symlinks will be skipped."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously copies the entire directory structure from <code>src</code> to <code>dest</code>,\nincluding subdirectories and files.</p>\n<p>When copying a directory to another directory, globs are not supported and\nbehavior is similar to <code>cp dir1/ dir2/</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.glob(pattern[, options])`",
              "name": "glob",
              "type": "method",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62695",
                    "description": "Add support for the `followSymlinks` option."
                  },
                  {
                    "version": [
                      "v24.1.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58182",
                    "description": "Add support for `URL` instances for `cwd` option."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56489",
                    "description": "Add support for `exclude` option to accept glob patterns."
                  },
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52837",
                    "description": "Add support for `withFileTypes` as an option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pattern` {string|string[]}",
                      "name": "pattern",
                      "type": "string|string[]"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} current working directory. **Default:** `process.cwd()`",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "current working directory."
                        },
                        {
                          "textRaw": "`exclude` {Function|string[]} Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it. **Default:** `undefined`. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported.",
                          "name": "exclude",
                          "type": "Function|string[]",
                          "default": "`undefined`. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported",
                          "desc": "Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it."
                        },
                        {
                          "textRaw": "`followSymlinks` {boolean} When `true`, symbolic links to directories are followed while expanding `**` patterns. **Default:** `false`.",
                          "name": "followSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, symbolic links to directories are followed while expanding `**` patterns."
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} `true` if the glob should return paths as Dirents, `false` otherwise. **Default:** `false`.",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if the glob should return paths as Dirents, `false` otherwise."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterator} An AsyncIterator that yields the paths of files that match the pattern.",
                    "name": "return",
                    "type": "AsyncIterator",
                    "desc": "An AsyncIterator that yields the paths of files that match the pattern."
                  }
                }
              ],
              "desc": "<p>When <code>followSymlinks</code> is enabled, detected symbolic link cycles are not\ntraversed recursively.</p>\n<pre><code class=\"language-mjs\">import { glob } from 'node:fs/promises';\n\nfor await (const entry of glob('**/*.js'))\n  console.log(entry);\n</code></pre>\n<pre><code class=\"language-cjs\">const { glob } = require('node:fs/promises');\n\n(async () => {\n  for await (const entry of glob('**/*.js'))\n    console.log(entry);\n})();\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.lchmod(path, mode)`",
              "name": "lchmod",
              "type": "method",
              "meta": {
                "changes": [],
                "deprecated": [
                  "v10.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer}",
                      "name": "mode",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the permissions on a symbolic link.</p>\n<p>This method is only implemented on macOS.</p>"
            },
            {
              "textRaw": "`fsPromises.lchown(path, uid, gid)`",
              "name": "lchown",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "This API is no longer deprecated."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the ownership on a symbolic link.</p>"
            },
            {
              "textRaw": "`fsPromises.lutimes(path, atime, mtime)`",
              "name": "lutimes",
              "type": "method",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the access and modification times of a file in the same way as\n<a href=\"#fspromisesutimespath-atime-mtime\"><code>fsPromises.utimes()</code></a>, with the difference that if the path refers to a\nsymbolic link, then the link is not dereferenced: instead, the timestamps of\nthe symbolic link itself are changed.</p>"
            },
            {
              "textRaw": "`fsPromises.link(existingPath, newPath)`",
              "name": "link",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`existingPath` {string|Buffer|URL}",
                      "name": "existingPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Creates a new link from the <code>existingPath</code> to the <code>newPath</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fsPromises.lstat(path[, options])`",
              "name": "lstat",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the {fs.Stats} object for the given symbolic link `path`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the {fs.Stats} object for the given symbolic link `path`."
                  }
                }
              ],
              "desc": "<p>Equivalent to <a href=\"#fspromisesstatpath-options\"><code>fsPromises.stat()</code></a> unless <code>path</code> refers to a symbolic link,\nin which case the link itself is stat-ed, not the file that it refers to.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a> document for more detail.</p>"
            },
            {
              "textRaw": "`fsPromises.mkdir(path[, options])`",
              "name": "mkdir",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object|integer}",
                      "name": "options",
                      "type": "Object|integer",
                      "options": [
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`mode` {string|integer} Not supported on Windows. See File modes for more details. **Default:** `0o777`.",
                          "name": "mode",
                          "type": "string|integer",
                          "default": "`0o777`",
                          "desc": "Not supported on Windows. See File modes for more details."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`."
                  }
                }
              ],
              "desc": "<p>Asynchronously creates a directory.</p>\n<p>The optional <code>options</code> argument can be an integer specifying <code>mode</code> (permission\nand sticky bits), or an object with a <code>mode</code> property and a <code>recursive</code>\nproperty indicating whether parent directories should be created. Calling\n<code>fsPromises.mkdir()</code> when <code>path</code> is a directory that exists results in a\nrejection only when <code>recursive</code> is false.</p>\n<pre><code class=\"language-mjs\">import { mkdir } from 'node:fs/promises';\n\ntry {\n  const projectFolder = new URL('./test/project/', import.meta.url);\n  const createDir = await mkdir(projectFolder, { recursive: true });\n\n  console.log(`created ${createDir}`);\n} catch (err) {\n  console.error(err.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { mkdir } = require('node:fs/promises');\nconst { join } = require('node:path');\n\nasync function makeDirectory() {\n  const projectFolder = join(__dirname, 'test', 'project');\n  const dirCreation = await mkdir(projectFolder, { recursive: true });\n\n  console.log(dirCreation);\n  return dirCreation;\n}\n\nmakeDirectory().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.mkdtemp(prefix[, options])`",
              "name": "mkdtemp",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48828",
                    "description": "The `prefix` parameter now accepts buffers and URL."
                  },
                  {
                    "version": [
                      "v16.5.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39028",
                    "description": "The `prefix` parameter now accepts an empty string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a string containing the file system path of the newly created temporary directory.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a string containing the file system path of the newly created temporary directory."
                  }
                }
              ],
              "desc": "<p>Creates a unique temporary directory. A unique directory name is generated by\nappending six random characters to the end of the provided <code>prefix</code>. Due to\nplatform inconsistencies, avoid trailing <code>X</code> characters in <code>prefix</code>. Some\nplatforms, notably the BSDs, can return more than six random characters, and\nreplace trailing <code>X</code> characters in <code>prefix</code> with random characters.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>\n<pre><code class=\"language-mjs\">import { mkdtemp } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { tmpdir } from 'node:os';\n\ntry {\n  await mkdtemp(join(tmpdir(), 'foo-'));\n} catch (err) {\n  console.error(err);\n}\n</code></pre>\n<p>The <code>fsPromises.mkdtemp()</code> method will append the six randomly selected\ncharacters directly to the <code>prefix</code> string. For instance, given a directory\n<code>/tmp</code>, if the intention is to create a temporary directory <em>within</em> <code>/tmp</code>, the\n<code>prefix</code> must end with a trailing platform-specific path separator\n(<code>require('node:path').sep</code>).</p>"
            },
            {
              "textRaw": "`fsPromises.mkdtempDisposable(prefix[, options])`",
              "name": "mkdtempDisposable",
              "type": "method",
              "meta": {
                "added": [
                  "v24.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a Promise for an async-disposable Object:",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a Promise for an async-disposable Object:",
                    "options": [
                      {
                        "textRaw": "`path` {string} The path of the created directory.",
                        "name": "path",
                        "type": "string",
                        "desc": "The path of the created directory."
                      },
                      {
                        "textRaw": "`remove` {AsyncFunction} A function which removes the created directory.",
                        "name": "remove",
                        "type": "AsyncFunction",
                        "desc": "A function which removes the created directory."
                      },
                      {
                        "textRaw": "`[Symbol.asyncDispose]` {AsyncFunction} The same as `remove`.",
                        "name": "[Symbol.asyncDispose]",
                        "type": "AsyncFunction",
                        "desc": "The same as `remove`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>The resulting Promise holds an async-disposable object whose <code>path</code> property\nholds the created directory path. When the object is disposed, the directory\nand its contents will be removed asynchronously if it still exists. If the\ndirectory cannot be deleted, disposal will throw an error. The object has an\nasync <code>remove()</code> method which will perform the same task.</p>\n<p>Both this function and the disposal function on the resulting object are\nasync, so it should be used with <code>await</code> + <code>await using</code> as in\n<code>await using dir = await fsPromises.mkdtempDisposable('prefix')</code>.</p>\n<p>For detailed information, see the documentation of <a href=\"#fspromisesmkdtempprefix-options\"><code>fsPromises.mkdtemp()</code></a>.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>"
            },
            {
              "textRaw": "`fsPromises.open(path, flags[, mode])`",
              "name": "open",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v11.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23767",
                    "description": "The `flags` argument is now optional and defaults to `'r'`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`flags` {string|number} See support of file system `flags`. **Default:** `'r'`.",
                      "name": "flags",
                      "type": "string|number",
                      "default": "`'r'`",
                      "desc": "See support of file system `flags`."
                    },
                    {
                      "textRaw": "`mode` {string|integer} Sets the file mode (permission and sticky bits) if the file is created. See File modes for more details. **Default:** `0o666` (readable and writable)",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666` (readable and writable)",
                      "desc": "Sets the file mode (permission and sticky bits) if the file is created. See File modes for more details.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {FileHandle} object.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {FileHandle} object."
                  }
                }
              ],
              "desc": "<p>Opens a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>.</p>\n<p>Refer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a> documentation for more detail.</p>\n<p>Some characters (<code>&#x3C; > : \" / \\ | ? *</code>) are reserved under Windows as documented\nby <a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file\">Naming Files, Paths, and Namespaces</a>. Under NTFS, if the filename contains\na colon, Node.js will open a file system stream, as described by\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams\">this MSDN page</a>.</p>"
            },
            {
              "textRaw": "`fsPromises.opendir(path[, options])`",
              "name": "opendir",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": [
                      "v13.1.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`bufferSize` {number} Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. **Default:** `32`",
                          "name": "bufferSize",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage."
                        },
                        {
                          "textRaw": "`recursive` {boolean} Resolved `Dir` will be an {AsyncIterable} containing all sub files and directories. **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Resolved `Dir` will be an {AsyncIterable} containing all sub files and directories."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {fs.Dir}.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {fs.Dir}."
                  }
                }
              ],
              "desc": "<p>Asynchronously open a directory for iterative scanning. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man3/opendir.3.html\"><code>opendir(3)</code></a> documentation for more detail.</p>\n<p>Creates an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>, which contains all further functions for reading from\nand cleaning up the directory.</p>\n<p>The <code>encoding</code> option sets the encoding for the <code>path</code> while opening the\ndirectory and subsequent read operations.</p>\n<p>Example using async iteration:</p>\n<pre><code class=\"language-mjs\">import { opendir } from 'node:fs/promises';\n\ntry {\n  const dir = await opendir('./');\n  for await (const dirent of dir)\n    console.log(dirent.name);\n} catch (err) {\n  console.error(err);\n}\n</code></pre>\n<p>When using the async iterator, the <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a> object will be automatically\nclosed after the iterator exits.</p>"
            },
            {
              "textRaw": "`fsPromises.readdir(path[, options])`",
              "name": "readdir",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v10.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} **Default:** `false`",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`."
                  }
                }
              ],
              "desc": "<p>Reads the contents of a directory.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe filenames. If the <code>encoding</code> is set to <code>'buffer'</code>, the filenames returned\nwill be passed as <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the returned array will contain\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects.</p>\n<pre><code class=\"language-mjs\">import { readdir } from 'node:fs/promises';\n\ntry {\n  const files = await readdir(path);\n  for (const file of files)\n    console.log(file);\n} catch (err) {\n  console.error(err);\n}\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.readFile(path[, options])`",
              "name": "readFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35911",
                    "description": "The options argument may include an AbortSignal to abort an ongoing readFile request."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|FileHandle} filename or `FileHandle`",
                      "name": "path",
                      "type": "string|Buffer|URL|FileHandle",
                      "desc": "filename or `FileHandle`"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `null`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress readFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress readFile"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the contents of the file.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the contents of the file."
                  }
                }
              ],
              "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<p>If no encoding is specified (using <code>options.encoding</code>), the data is returned\nas a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object. Otherwise, the data will be a string.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>\n<p>When the <code>path</code> is a directory, the behavior of <code>fsPromises.readFile()</code> is\nplatform-specific. On macOS, Linux, and Windows, the promise will be rejected\nwith an error. On FreeBSD, a representation of the directory's contents will be\nreturned.</p>\n<p>An example of reading a <code>package.json</code> file located in the same directory of the\nrunning code:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs/promises';\ntry {\n  const filePath = new URL('./package.json', import.meta.url);\n  const contents = await readFile(filePath, { encoding: 'utf8' });\n  console.log(contents);\n} catch (err) {\n  console.error(err.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { readFile } = require('node:fs/promises');\nconst { resolve } = require('node:path');\nasync function logFile() {\n  try {\n    const filePath = resolve('./package.json');\n    const contents = await readFile(filePath, { encoding: 'utf8' });\n    console.log(contents);\n  } catch (err) {\n    console.error(err.message);\n  }\n}\nlogFile();\n</code></pre>\n<p>It is possible to abort an ongoing <code>readFile</code> using an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a>. If a\nrequest is aborted the promise returned is rejected with an <code>AbortError</code>:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs/promises';\n\ntry {\n  const controller = new AbortController();\n  const { signal } = controller;\n  const promise = readFile(fileName, { signal });\n\n  // Abort the request before the promise settles.\n  controller.abort();\n\n  await promise;\n} catch (err) {\n  // When a request is aborted - err is an AbortError\n  console.error(err);\n}\n</code></pre>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.readFile</code> performs.</p>\n<p>Any specified <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support reading.</p>"
            },
            {
              "textRaw": "`fsPromises.readlink(path[, options])`",
              "name": "readlink",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the `linkString` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the `linkString` upon success."
                  }
                }
              ],
              "desc": "<p>Reads the contents of the symbolic link referred to by <code>path</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a> documentation for more detail. The promise is fulfilled with the <code>linkString</code> upon success.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe link path returned. If the <code>encoding</code> is set to <code>'buffer'</code>, the link path\nreturned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>"
            },
            {
              "textRaw": "`fsPromises.realpath(path[, options])`",
              "name": "realpath",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the resolved path upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the resolved path upon success."
                  }
                }
              ],
              "desc": "<p>Determines the actual location of <code>path</code> using the same semantics as the\n<code>fs.realpath.native()</code> function.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path. If the <code>encoding</code> is set to <code>'buffer'</code>, the path returned will be\npassed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>On Linux, when Node.js is linked against musl libc, the procfs file system must\nbe mounted on <code>/proc</code> in order for this function to work. Glibc does not have\nthis restriction.</p>"
            },
            {
              "textRaw": "`fsPromises.rename(oldPath, newPath)`",
              "name": "rename",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`oldPath` {string|Buffer|URL}",
                      "name": "oldPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Renames <code>oldPath</code> to <code>newPath</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.rmdir(path[, options])`",
              "name": "rmdir",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "Remove `recursive` option."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fsPromises.rmdir(path, { recursive: true })` on a `path` that is a file is no longer permitted and results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fsPromises.rmdir(path, { recursive: true })` on a `path` that does not exist is no longer permitted and results in a `ENOENT` error."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "The `recursive` option is deprecated, using it triggers a deprecation warning."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "The `recursive` option is deprecated, use `fsPromises.rm` instead."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30644",
                    "description": "The `maxBusyTries` option is renamed to `maxRetries`, and its default is 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29168",
                    "description": "The `recursive`, `maxBusyTries`, and `emfileWait` options are now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object} There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "name": "options",
                      "type": "Object",
                      "desc": "There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Removes the directory identified by <code>path</code>.</p>\n<p>Using <code>fsPromises.rmdir()</code> on a file (not a directory) results in the\npromise being rejected with an <code>ENOENT</code> error on Windows and an <code>ENOTDIR</code>\nerror on POSIX.</p>\n<p>To get a behavior similar to the <code>rm -rf</code> Unix command, use\n<a href=\"#fspromisesrmpath-options\"><code>fsPromises.rm()</code></a> with options <code>{ recursive: true, force: true }</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.rm(path[, options])`",
              "name": "rm",
              "type": "method",
              "meta": {
                "added": [
                  "v14.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`force` {boolean} When `true`, exceptions will be ignored if `path` does not exist. **Default:** `false`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, exceptions will be ignored if `path` does not exist."
                        },
                        {
                          "textRaw": "`maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`. **Default:** `0`.",
                          "name": "maxRetries",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`."
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure."
                        },
                        {
                          "textRaw": "`retryDelay` {integer} The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`.",
                          "name": "retryDelay",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Removes files and directories (modeled on the standard POSIX <code>rm</code> utility).</p>"
            },
            {
              "textRaw": "`fsPromises.stat(path[, options])`",
              "name": "stat",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61178",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the {fs.Stats} object for the given `path`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the {fs.Stats} object for the given `path`."
                  }
                }
              ]
            },
            {
              "textRaw": "`fsPromises.statfs(path[, options])`",
              "name": "statfs",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.StatFs} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.StatFs} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the {fs.StatFs} object for the given `path`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the {fs.StatFs} object for the given `path`."
                  }
                }
              ]
            },
            {
              "textRaw": "`fsPromises.symlink(target, path[, type])`",
              "name": "symlink",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42894",
                    "description": "If the `type` argument is `null` or omitted, Node.js will autodetect `target` type and automatically select `dir` or `file`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {string|Buffer|URL}",
                      "name": "target",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`type` {string|null} **Default:** `null`",
                      "name": "type",
                      "type": "string|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Creates a symbolic link.</p>\n<p>The <code>type</code> argument is only used on Windows platforms and can be one of <code>'dir'</code>,\n<code>'file'</code>, or <code>'junction'</code>. If the <code>type</code> argument is <code>null</code>, Node.js will\nautodetect <code>target</code> type and use <code>'file'</code> or <code>'dir'</code>. If the <code>target</code> does not\nexist, <code>'file'</code> will be used. Windows junction points require the destination\npath to be absolute. When using <code>'junction'</code>, the <code>target</code> argument will\nautomatically be normalized to absolute path. Junction points on NTFS volumes\ncan only point to directories.</p>"
            },
            {
              "textRaw": "`fsPromises.truncate(path[, len])`",
              "name": "truncate",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Truncates (shortens or extends the length) of the content at <code>path</code> to <code>len</code>\nbytes.</p>"
            },
            {
              "textRaw": "`fsPromises.unlink(path)`",
              "name": "unlink",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>If <code>path</code> refers to a symbolic link, then the link is removed without affecting\nthe file or directory to which that link refers. If the <code>path</code> refers to a file\npath that is not a symbolic link, the file is deleted. See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>\ndocumentation for more detail.</p>"
            },
            {
              "textRaw": "`fsPromises.utimes(path, atime, mtime)`",
              "name": "utimes",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Change the file system timestamps of the object referenced by <code>path</code>.</p>\n<p>The <code>atime</code> and <code>mtime</code> arguments follow these rules:</p>\n<ul>\n<li>Values can be either numbers representing Unix epoch time, <code>Date</code>s, or a\nnumeric string like <code>'123456789.0'</code>.</li>\n<li>If the value can not be converted to a number, or is <code>NaN</code>, <code>Infinity</code>, or\n<code>-Infinity</code>, an <code>Error</code> will be thrown.</li>\n</ul>"
            },
            {
              "textRaw": "`fsPromises.watch(filename[, options])`",
              "name": "watch",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`persistent` {boolean} Indicates whether the process should continue to run as long as files are being watched. **Default:** `true`.",
                          "name": "persistent",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Indicates whether the process should continue to run as long as files are being watched."
                        },
                        {
                          "textRaw": "`recursive` {boolean} Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats). **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats)."
                        },
                        {
                          "textRaw": "`encoding` {string} Specifies the character encoding to be used for the filename passed to the listener. **Default:** `'utf8'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "Specifies the character encoding to be used for the filename passed to the listener."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An {AbortSignal} used to signal when the watcher should stop.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An {AbortSignal} used to signal when the watcher should stop."
                        },
                        {
                          "textRaw": "`maxQueue` {number} Specifies the number of events to queue between iterations of the {AsyncIterator} returned. **Default:** `2048`.",
                          "name": "maxQueue",
                          "type": "number",
                          "default": "`2048`",
                          "desc": "Specifies the number of events to queue between iterations of the {AsyncIterator} returned."
                        },
                        {
                          "textRaw": "`overflow` {string} Either `'ignore'` or `'throw'` when there are more events to be queued than `maxQueue` allows. `'ignore'` means overflow events are dropped and a warning is emitted, while `'throw'` means to throw an exception. **Default:** `'ignore'`.",
                          "name": "overflow",
                          "type": "string",
                          "default": "`'ignore'`",
                          "desc": "Either `'ignore'` or `'throw'` when there are more events to be queued than `maxQueue` allows. `'ignore'` means overflow events are dropped and a warning is emitted, while `'throw'` means to throw an exception."
                        },
                        {
                          "textRaw": "`ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore. **Default:** `undefined`.",
                          "name": "ignore",
                          "type": "string|RegExp|Function|Array",
                          "default": "`undefined`",
                          "desc": "Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterator} of objects with the properties:",
                    "name": "return",
                    "type": "AsyncIterator",
                    "desc": "of objects with the properties:",
                    "options": [
                      {
                        "textRaw": "`eventType` {string} The type of change",
                        "name": "eventType",
                        "type": "string",
                        "desc": "The type of change"
                      },
                      {
                        "textRaw": "`filename` {string|Buffer|null} The name of the file changed.",
                        "name": "filename",
                        "type": "string|Buffer|null",
                        "desc": "The name of the file changed."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns an async iterator that watches for changes on <code>filename</code>, where <code>filename</code>\nis either a file or a directory.</p>\n<pre><code class=\"language-js\">const { watch } = require('node:fs/promises');\n\nconst ac = new AbortController();\nconst { signal } = ac;\nsetTimeout(() => ac.abort(), 10000);\n\n(async () => {\n  try {\n    const watcher = watch(__filename, { signal });\n    for await (const event of watcher)\n      console.log(event);\n  } catch (err) {\n    if (err.name === 'AbortError')\n      return;\n    throw err;\n  }\n})();\n</code></pre>\n<p>On most platforms, <code>'rename'</code> is emitted whenever a filename appears or\ndisappears in the directory.</p>\n<p>All the <a href=\"#caveats\">caveats</a> for <code>fs.watch()</code> also apply to <code>fsPromises.watch()</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.writeFile(file, data[, options])`",
              "name": "writeFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50009",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": [
                      "v15.14.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37490",
                    "description": "The `data` argument supports `AsyncIterable`, `Iterable`, and `Stream`."
                  },
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35993",
                    "description": "The options argument may include an AbortSignal to abort an ongoing writeFile request."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string|Buffer|URL|FileHandle} filename or `FileHandle`",
                      "name": "file",
                      "type": "string|Buffer|URL|FileHandle",
                      "desc": "filename or `FileHandle`"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView|AsyncIterable|Stream}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView|AsyncIterable|Stream"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If all data is successfully written to the file, and `flush` is `true`, `filehandle.sync()` is used to flush the data. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If all data is successfully written to the file, and `flush` is `true`, `filehandle.sync()` is used to flush the data."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress writeFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress writeFile"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string, a buffer, an <a href=\"https://tc39.github.io/ecma262/#sec-asynciterable-interface\"><code>&#x3C;AsyncIterable></code></a>, or an {Iterable} object.</p>\n<p>The <code>encoding</code> option is ignored if <code>data</code> is a buffer.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<p>Any specified <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support writing.</p>\n<p>It is unsafe to use <code>fsPromises.writeFile()</code> multiple times on the same file\nwithout waiting for the promise to be settled.</p>\n<p>Similarly to <code>fsPromises.readFile</code> - <code>fsPromises.writeFile</code> is a convenience\nmethod that performs multiple <code>write</code> calls internally to write the buffer\npassed to it. For performance sensitive code consider using\n<a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> or <a href=\"#filehandlecreatewritestreamoptions\"><code>filehandle.createWriteStream()</code></a>.</p>\n<p>It is possible to use an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> to cancel an <code>fsPromises.writeFile()</code>.\nCancelation is \"best effort\", and some amount of data is likely still\nto be written.</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs/promises';\nimport { Buffer } from 'node:buffer';\n\ntry {\n  const controller = new AbortController();\n  const { signal } = controller;\n  const data = new Uint8Array(Buffer.from('Hello Node.js'));\n  const promise = writeFile('message.txt', data, { signal });\n\n  // Abort the request before the promise settles.\n  controller.abort();\n\n  await promise;\n} catch (err) {\n  // When a request is aborted - err is an AbortError\n  console.error(err);\n}\n</code></pre>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.writeFile</code> performs.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "constants",
              "type": "Object",
              "meta": {
                "added": [
                  "v18.4.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Returns an object containing commonly used constants for file system\noperations. The object is the same as <code>fs.constants</code>. See <a href=\"#fs-constants\">FS constants</a>\nfor more details.</p>"
            }
          ],
          "displayName": "Promises API"
        },
        {
          "textRaw": "Callback API",
          "name": "callback_api",
          "type": "module",
          "desc": "<p>The callback APIs perform all operations asynchronously, without blocking the\nevent loop, then invoke a callback function upon completion or error.</p>\n<p>The callback APIs use the underlying Node.js threadpool to perform file\nsystem operations off the event loop thread. These operations are not\nsynchronized or threadsafe. Care must be taken when performing multiple\nconcurrent modifications on the same file or data corruption may occur.</p>",
          "methods": [
            {
              "textRaw": "`fs.access(path[, mode], callback)`",
              "name": "access",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55862",
                    "description": "The constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK` and `fs.X_OK` which were present directly on `fs` are removed."
                  },
                  {
                    "version": "v20.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49683",
                    "description": "The constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK` and `fs.X_OK` which were present directly on `fs` are deprecated."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6534",
                    "description": "The constants like `fs.R_OK`, etc which were present directly on `fs` were moved into `fs.constants` as a soft deprecation. Thus for Node.js `< v6.3.0` use `fs` to access those constants, or do something like `(fs.constants || fs).R_OK` to work with all versions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer} **Default:** `fs.constants.F_OK`",
                      "name": "mode",
                      "type": "integer",
                      "default": "`fs.constants.F_OK`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Tests a user's permissions for the file or directory specified by <code>path</code>.\nThe <code>mode</code> argument is an optional integer that specifies the accessibility\nchecks to be performed. <code>mode</code> should be either the value <code>fs.constants.F_OK</code>\nor a mask consisting of the bitwise OR of any of <code>fs.constants.R_OK</code>,\n<code>fs.constants.W_OK</code>, and <code>fs.constants.X_OK</code> (e.g.\n<code>fs.constants.W_OK | fs.constants.R_OK</code>). Check <a href=\"#file-access-constants\">File access constants</a> for\npossible values of <code>mode</code>.</p>\n<p>The final argument, <code>callback</code>, is a callback function that is invoked with\na possible error argument. If any of the accessibility checks fail, the error\nargument will be an <code>Error</code> object. The following examples check if\n<code>package.json</code> exists, and if it is readable or writable.</p>\n<pre><code class=\"language-mjs\">import { access, constants } from 'node:fs';\n\nconst file = 'package.json';\n\n// Check if the file exists in the current directory.\naccess(file, constants.F_OK, (err) => {\n  console.log(`${file} ${err ? 'does not exist' : 'exists'}`);\n});\n\n// Check if the file is readable.\naccess(file, constants.R_OK, (err) => {\n  console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);\n});\n\n// Check if the file is writable.\naccess(file, constants.W_OK, (err) => {\n  console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);\n});\n\n// Check if the file is readable and writable.\naccess(file, constants.R_OK | constants.W_OK, (err) => {\n  console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);\n});\n</code></pre>\n<p>Do not use <code>fs.access()</code> to check for the accessibility of a file before calling\n<code>fs.open()</code>, <code>fs.readFile()</code>, or <code>fs.writeFile()</code>. Doing\nso introduces a race condition, since other processes may change the file's\nstate between the two calls. Instead, user code should open/read/write the\nfile directly and handle the error raised if the file is not accessible.</p>\n<p><strong>write (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { access, open, close } from 'node:fs';\n\naccess('myfile', (err) => {\n  if (!err) {\n    console.error('myfile already exists');\n    return;\n  }\n\n  open('myfile', 'wx', (err, fd) => {\n    if (err) throw err;\n\n    try {\n      writeMyData(fd);\n    } finally {\n      close(fd, (err) => {\n        if (err) throw err;\n      });\n    }\n  });\n});\n</code></pre>\n<p><strong>write (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\n\nopen('myfile', 'wx', (err, fd) => {\n  if (err) {\n    if (err.code === 'EEXIST') {\n      console.error('myfile already exists');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    writeMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p><strong>read (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { access, open, close } from 'node:fs';\naccess('myfile', (err) => {\n  if (err) {\n    if (err.code === 'ENOENT') {\n      console.error('myfile does not exist');\n      return;\n    }\n\n    throw err;\n  }\n\n  open('myfile', 'r', (err, fd) => {\n    if (err) throw err;\n\n    try {\n      readMyData(fd);\n    } finally {\n      close(fd, (err) => {\n        if (err) throw err;\n      });\n    }\n  });\n});\n</code></pre>\n<p><strong>read (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\n\nopen('myfile', 'r', (err, fd) => {\n  if (err) {\n    if (err.code === 'ENOENT') {\n      console.error('myfile does not exist');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    readMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p>The \"not recommended\" examples above check for accessibility and then use the\nfile; the \"recommended\" examples are better because they use the file directly\nand handle the error, if any.</p>\n<p>In general, check for the accessibility of a file only if the file will not be\nused directly, for example when its accessibility is a signal from another\nprocess.</p>\n<p>On Windows, access-control policies (ACLs) on a directory may limit access to\na file or directory. The <code>fs.access()</code> function, however, does not check the\nACL and therefore may report that a path is accessible even if the ACL restricts\nthe user from reading or writing to it.</p>"
            },
            {
              "textRaw": "`fs.appendFile(path, data[, options], callback)`",
              "name": "appendFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50095",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|number} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|number",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'a'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'a'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously append data to a file, creating the file if it does not yet\nexist. <code>data</code> can be a string or a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<pre><code class=\"language-mjs\">import { appendFile } from 'node:fs';\n\nappendFile('message.txt', 'data to append', (err) => {\n  if (err) throw err;\n  console.log('The \"data to append\" was appended to file!');\n});\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { appendFile } from 'node:fs';\n\nappendFile('message.txt', 'data to append', 'utf8', callback);\n</code></pre>\n<p>The <code>path</code> may be specified as a numeric file descriptor that has been opened\nfor appending (using <code>fs.open()</code> or <code>fs.openSync()</code>). The file descriptor will\nnot be closed automatically.</p>\n<pre><code class=\"language-mjs\">import { open, close, appendFile } from 'node:fs';\n\nfunction closeFd(fd) {\n  close(fd, (err) => {\n    if (err) throw err;\n  });\n}\n\nopen('message.txt', 'a', (err, fd) => {\n  if (err) throw err;\n\n  try {\n    appendFile(fd, 'data to append', 'utf8', (err) => {\n      closeFd(fd);\n      if (err) throw err;\n    });\n  } catch (err) {\n    closeFd(fd);\n    throw err;\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.chmod(path, mode, callback)`",
              "name": "chmod",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously changes the permissions of a file. No arguments other than a\npossible exception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a> documentation for more detail.</p>\n<pre><code class=\"language-mjs\">import { chmod } from 'node:fs';\n\nchmod('my_file.txt', 0o775, (err) => {\n  if (err) throw err;\n  console.log('The permissions for file \"my_file.txt\" have been changed!');\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "File modes",
                  "name": "file_modes",
                  "type": "module",
                  "desc": "<p>The <code>mode</code> argument used in both the <code>fs.chmod()</code> and <code>fs.chmodSync()</code>\nmethods is a numeric bitmask created using a logical OR of the following\nconstants:</p>\n<table>\n<thead>\n<tr>\n<th>Constant</th>\n<th>Octal</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>fs.constants.S_IRUSR</code></td>\n<td><code>0o400</code></td>\n<td>read by owner</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IWUSR</code></td>\n<td><code>0o200</code></td>\n<td>write by owner</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IXUSR</code></td>\n<td><code>0o100</code></td>\n<td>execute/search by owner</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IRGRP</code></td>\n<td><code>0o40</code></td>\n<td>read by group</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IWGRP</code></td>\n<td><code>0o20</code></td>\n<td>write by group</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IXGRP</code></td>\n<td><code>0o10</code></td>\n<td>execute/search by group</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IROTH</code></td>\n<td><code>0o4</code></td>\n<td>read by others</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IWOTH</code></td>\n<td><code>0o2</code></td>\n<td>write by others</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IXOTH</code></td>\n<td><code>0o1</code></td>\n<td>execute/search by others</td>\n</tr>\n</tbody>\n</table>\n<p>An easier method of constructing the <code>mode</code> is to use a sequence of three\noctal digits (e.g. <code>765</code>). The left-most digit (<code>7</code> in the example), specifies\nthe permissions for the file owner. The middle digit (<code>6</code> in the example),\nspecifies permissions for the group. The right-most digit (<code>5</code> in the example),\nspecifies the permissions for others.</p>\n<table>\n<thead>\n<tr>\n<th>Number</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>7</code></td>\n<td>read, write, and execute</td>\n</tr>\n<tr>\n<td><code>6</code></td>\n<td>read and write</td>\n</tr>\n<tr>\n<td><code>5</code></td>\n<td>read and execute</td>\n</tr>\n<tr>\n<td><code>4</code></td>\n<td>read only</td>\n</tr>\n<tr>\n<td><code>3</code></td>\n<td>write and execute</td>\n</tr>\n<tr>\n<td><code>2</code></td>\n<td>write only</td>\n</tr>\n<tr>\n<td><code>1</code></td>\n<td>execute only</td>\n</tr>\n<tr>\n<td><code>0</code></td>\n<td>no permission</td>\n</tr>\n</tbody>\n</table>\n<p>For example, the octal value <code>0o765</code> means:</p>\n<ul>\n<li>The owner may read, write, and execute the file.</li>\n<li>The group may read and write the file.</li>\n<li>Others may read and execute the file.</li>\n</ul>\n<p>When using raw numbers where file modes are expected, any value larger than\n<code>0o777</code> may result in platform-specific behaviors that are not supported to work\nconsistently. Therefore constants like <code>S_ISVTX</code>, <code>S_ISGID</code>, or <code>S_ISUID</code> are\nnot exposed in <code>fs.constants</code>.</p>\n<p>Caveats: on Windows only the write permission can be changed, and the\ndistinction among the permissions of group, owner, or others is not\nimplemented.</p>",
                  "displayName": "File modes"
                }
              ]
            },
            {
              "textRaw": "`fs.chown(path, uid, gid, callback)`",
              "name": "chown",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.97"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously changes owner and group of a file. No arguments other than a\npossible exception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.close(fd[, callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v15.9.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37174",
                    "description": "A default callback is now used if one is not provided."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Closes the file descriptor. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>Calling <code>fs.close()</code> on any file descriptor (<code>fd</code>) that is currently in use\nthrough any other <code>fs</code> operation may lead to undefined behavior.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/close.2.html\"><code>close(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.copyFile(src, dest[, mode], callback)`",
              "name": "copyFile",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27044",
                    "description": "Changed `flags` argument to `mode` and imposed stricter type validation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|Buffer|URL} source filename to copy",
                      "name": "src",
                      "type": "string|Buffer|URL",
                      "desc": "source filename to copy"
                    },
                    {
                      "textRaw": "`dest` {string|Buffer|URL} destination filename of the copy operation",
                      "name": "dest",
                      "type": "string|Buffer|URL",
                      "desc": "destination filename of the copy operation"
                    },
                    {
                      "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`.",
                      "name": "mode",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "modifiers for copy operation.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists. No arguments other than a possible exception are given to the\ncallback function. Node.js makes no guarantees about the atomicity of the copy\noperation. If an error occurs after the destination file has been opened for\nwriting, Node.js will attempt to remove the destination.</p>\n<p><code>mode</code> is an optional integer that specifies the behavior\nof the copy operation. It is possible to create a mask consisting of the bitwise\nOR of two or more values (e.g.\n<code>fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE</code>).</p>\n<ul>\n<li><code>fs.constants.COPYFILE_EXCL</code>: The copy operation will fail if <code>dest</code> already\nexists.</li>\n<li><code>fs.constants.COPYFILE_FICLONE</code>: The copy operation will attempt to create a\ncopy-on-write reflink. If the platform does not support copy-on-write, then a\nfallback copy mechanism is used.</li>\n<li><code>fs.constants.COPYFILE_FICLONE_FORCE</code>: The copy operation will attempt to\ncreate a copy-on-write reflink. If the platform does not support\ncopy-on-write, then the operation will fail.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { copyFile, constants } from 'node:fs';\n\nfunction callback(err) {\n  if (err) throw err;\n  console.log('source.txt was copied to destination.txt');\n}\n\n// destination.txt will be created or overwritten by default.\ncopyFile('source.txt', 'destination.txt', callback);\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\ncopyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);\n</code></pre>"
            },
            {
              "textRaw": "`fs.cp(src, dest[, options], callback)`",
              "name": "cp",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53127",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47084",
                    "description": "Accept an additional `mode` option to specify the copy behavior as the `mode` argument of `fs.copyFile()`."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41819",
                    "description": "Accepts an additional `verbatimSymlinks` option to specify whether to perform path resolution for symlinks."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|URL} source path to copy.",
                      "name": "src",
                      "type": "string|URL",
                      "desc": "source path to copy."
                    },
                    {
                      "textRaw": "`dest` {string|URL} destination path to copy to.",
                      "name": "dest",
                      "type": "string|URL",
                      "desc": "destination path to copy to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`dereference` {boolean} dereference symlinks. **Default:** `false`.",
                          "name": "dereference",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "dereference symlinks."
                        },
                        {
                          "textRaw": "`errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`.",
                          "name": "errorOnExist",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "when `force` is `false`, and the destination exists, throw an error."
                        },
                        {
                          "textRaw": "`filter` {Function} Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that fulfills with `true` or `false`. **Default:** `undefined`.",
                          "name": "filter",
                          "type": "Function",
                          "default": "`undefined`",
                          "desc": "Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that fulfills with `true` or `false`.",
                          "options": [
                            {
                              "textRaw": "`src` {string} source path to copy.",
                              "name": "src",
                              "type": "string",
                              "desc": "source path to copy."
                            },
                            {
                              "textRaw": "`dest` {string} destination path to copy to.",
                              "name": "dest",
                              "type": "string",
                              "desc": "destination path to copy to."
                            },
                            {
                              "textRaw": "Returns: {boolean|Promise} A value that is coercible to `boolean` or a `Promise` that fulfils with such value.",
                              "name": "return",
                              "type": "boolean|Promise",
                              "desc": "A value that is coercible to `boolean` or a `Promise` that fulfils with such value."
                            }
                          ]
                        },
                        {
                          "textRaw": "`force` {boolean} overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior. **Default:** `true`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior."
                        },
                        {
                          "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`. See `mode` flag of `fs.copyFile()`.",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0`. See `mode` flag of `fs.copyFile()`",
                          "desc": "modifiers for copy operation."
                        },
                        {
                          "textRaw": "`preserveTimestamps` {boolean} When `true` timestamps from `src` will be preserved. **Default:** `false`.",
                          "name": "preserveTimestamps",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` timestamps from `src` will be preserved."
                        },
                        {
                          "textRaw": "`recursive` {boolean} copy directories recursively **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "copy directories recursively"
                        },
                        {
                          "textRaw": "`verbatimSymlinks` {boolean} When `true`, path resolution for symlinks will be skipped. **Default:** `false`",
                          "name": "verbatimSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, path resolution for symlinks will be skipped."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously copies the entire directory structure from <code>src</code> to <code>dest</code>,\nincluding subdirectories and files.</p>\n<p>When copying a directory to another directory, globs are not supported and\nbehavior is similar to <code>cp dir1/ dir2/</code>.</p>"
            },
            {
              "textRaw": "`fs.createReadStream(path[, options])`",
              "name": "createReadStream",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `open` method if an `fd` was provided."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `close` method if `autoClose` is `false`."
                  },
                  {
                    "version": "v15.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36431",
                    "description": "Add support for `AbortSignal`."
                  },
                  {
                    "version": [
                      "v15.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35922",
                    "description": "The `fd` option accepts FileHandle arguments."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31408",
                    "description": "Change `emitClose` default to `true`."
                  },
                  {
                    "version": [
                      "v13.6.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29083",
                    "description": "The `fs` options allow overriding the used `fs` implementation."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29212",
                    "description": "Enable `emitClose` option."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19898",
                    "description": "Impose new restrictions on `start` and `end`, throwing more appropriate errors in cases when we cannot reasonably handle the input values."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v2.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1845",
                    "description": "The passed `options` object can be a string now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`flags` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flags",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `null`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`fd` {integer|FileHandle} **Default:** `null`",
                          "name": "fd",
                          "type": "integer|FileHandle",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`autoClose` {boolean} **Default:** `true`",
                          "name": "autoClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`emitClose` {boolean} **Default:** `true`",
                          "name": "emitClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`start` {integer}",
                          "name": "start",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`end` {integer} **Default:** `Infinity`",
                          "name": "end",
                          "type": "integer",
                          "default": "`Infinity`"
                        },
                        {
                          "textRaw": "`highWaterMark` {integer} **Default:** `64 * 1024`",
                          "name": "highWaterMark",
                          "type": "integer",
                          "default": "`64 * 1024`"
                        },
                        {
                          "textRaw": "`fs` {Object|null} **Default:** `null`",
                          "name": "fs",
                          "type": "Object|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal|null} **Default:** `null`",
                          "name": "signal",
                          "type": "AbortSignal|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.ReadStream}",
                    "name": "return",
                    "type": "fs.ReadStream"
                  }
                }
              ],
              "desc": "<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart counting at 0, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. If <code>fd</code> is specified and <code>start</code> is\nomitted or <code>undefined</code>, <code>fs.createReadStream()</code> reads sequentially from the\ncurrent file position. The <code>encoding</code> can be any one of those accepted by\n<a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>fd</code> is specified, <code>ReadStream</code> will ignore the <code>path</code> argument and will use\nthe specified file descriptor. This means that no <code>'open'</code> event will be\nemitted. <code>fd</code> should be blocking; non-blocking <code>fd</code>s should be passed to\n<a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>If <code>fd</code> points to a character device that only supports blocking reads\n(such as keyboard or sound card), read operations do not finish until data is\navailable. This can prevent the process from exiting and the stream from\nclosing naturally.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>\n<p>By providing the <code>fs</code> option, it is possible to override the corresponding <code>fs</code>\nimplementations for <code>open</code>, <code>read</code>, and <code>close</code>. When providing the <code>fs</code> option,\nan override for <code>read</code> is required. If no <code>fd</code> is provided, an override for\n<code>open</code> is also required. If <code>autoClose</code> is <code>true</code>, an override for <code>close</code> is\nalso required.</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\n\n// Create a stream from some character device.\nconst stream = createReadStream('/dev/input/event0');\nsetTimeout(() => {\n  stream.close(); // This may not close the stream.\n  // Artificially marking end-of-stream, as if the underlying resource had\n  // indicated end-of-file by itself, allows the stream to close.\n  // This does not cancel pending read operations, and if there is such an\n  // operation, the process may still not be able to exit successfully\n  // until it finishes.\n  stream.push(null);\n  stream.read(0);\n}, 100);\n</code></pre>\n<p>If <code>autoClose</code> is false, then the file descriptor won't be closed, even if\nthere's an error. It is the application's responsibility to close it and make\nsure there's no file descriptor leak. If <code>autoClose</code> is set to true (default\nbehavior), on <code>'error'</code> or <code>'end'</code> the file descriptor will be closed\nautomatically.</p>\n<p><code>mode</code> sets the file mode (permission and sticky bits), but only if the\nfile was created.</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\n\ncreateReadStream('sample.txt', { start: 90, end: 99 });\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>"
            },
            {
              "textRaw": "`fs.createWriteStream(path[, options])`",
              "name": "createWriteStream",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50093",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `open` method if an `fd` was provided."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `close` method if `autoClose` is `false`."
                  },
                  {
                    "version": "v15.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36431",
                    "description": "Add support for `AbortSignal`."
                  },
                  {
                    "version": [
                      "v15.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35922",
                    "description": "The `fd` option accepts FileHandle arguments."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31408",
                    "description": "Change `emitClose` default to `true`."
                  },
                  {
                    "version": [
                      "v13.6.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29083",
                    "description": "The `fs` options allow overriding the used `fs` implementation."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29212",
                    "description": "Enable `emitClose` option."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v5.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3679",
                    "description": "The `autoClose` option is supported now."
                  },
                  {
                    "version": "v2.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1845",
                    "description": "The passed `options` object can be a string now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`flags` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flags",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`fd` {integer|FileHandle} **Default:** `null`",
                          "name": "fd",
                          "type": "integer|FileHandle",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`autoClose` {boolean} **Default:** `true`",
                          "name": "autoClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`emitClose` {boolean} **Default:** `true`",
                          "name": "emitClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`start` {integer}",
                          "name": "start",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`fs` {Object|null} **Default:** `null`",
                          "name": "fs",
                          "type": "Object|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal|null} **Default:** `null`",
                          "name": "signal",
                          "type": "AbortSignal|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`highWaterMark` {number} **Default:** `16384`",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`16384`"
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.WriteStream}",
                    "name": "return",
                    "type": "fs.WriteStream"
                  }
                }
              ],
              "desc": "<p><code>options</code> may also include a <code>start</code> option to allow writing data at some\nposition past the beginning of the file, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. Modifying a file rather than\nreplacing it may require the <code>flags</code> option to be set to <code>r+</code> rather than the\ndefault <code>w</code>. The <code>encoding</code> can be any one of those accepted by <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>autoClose</code> is set to true (default behavior) on <code>'error'</code> or <code>'finish'</code>\nthe file descriptor will be closed automatically. If <code>autoClose</code> is false,\nthen the file descriptor won't be closed, even if there's an error.\nIt is the application's responsibility to close it and make sure there's no\nfile descriptor leak.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>\n<p>By providing the <code>fs</code> option it is possible to override the corresponding <code>fs</code>\nimplementations for <code>open</code>, <code>write</code>, <code>writev</code>, and <code>close</code>. Overriding <code>write()</code>\nwithout <code>writev()</code> can reduce performance as some optimizations (<code>_writev()</code>)\nwill be disabled. When providing the <code>fs</code> option, overrides for at least one of\n<code>write</code> and <code>writev</code> are required. If no <code>fd</code> option is supplied, an override\nfor <code>open</code> is also required. If <code>autoClose</code> is <code>true</code>, an override for <code>close</code>\nis also required.</p>\n<p>Like <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a>, if <code>fd</code> is specified, <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a> will ignore the <code>path</code> argument and will use the specified file descriptor. This means that no\n<code>'open'</code> event will be emitted. <code>fd</code> should be blocking; non-blocking <code>fd</code>s\nshould be passed to <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>"
            },
            {
              "textRaw": "`fs.exists(path, callback)`",
              "name": "exists",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ],
                "deprecated": [
                  "v1.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `fs.stat()` or `fs.access()` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`exists` {boolean}",
                          "name": "exists",
                          "type": "boolean"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Test whether or not the element at the given <code>path</code> exists by checking with the file system.\nThen call the <code>callback</code> argument with either true or false:</p>\n<pre><code class=\"language-mjs\">import { exists } from 'node:fs';\n\nexists('/etc/passwd', (e) => {\n  console.log(e ? 'it exists' : 'no passwd!');\n});\n</code></pre>\n<p><strong>The parameters for this callback are not consistent with other Node.js\ncallbacks.</strong> Normally, the first parameter to a Node.js callback is an <code>err</code>\nparameter, optionally followed by other parameters. The <code>fs.exists()</code> callback\nhas only one boolean parameter. This is one reason <code>fs.access()</code> is recommended\ninstead of <code>fs.exists()</code>.</p>\n<p>If <code>path</code> is a symbolic link, it is followed. Thus, if <code>path</code> exists but points\nto a non-existent element, the callback will receive the value <code>false</code>.</p>\n<p>Using <code>fs.exists()</code> to check for the existence of a file before calling\n<code>fs.open()</code>, <code>fs.readFile()</code>, or <code>fs.writeFile()</code> is not recommended. Doing\nso introduces a race condition, since other processes may change the file's\nstate between the two calls. Instead, user code should open/read/write the\nfile directly and handle the error raised if the file does not exist.</p>\n<p><strong>write (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { exists, open, close } from 'node:fs';\n\nexists('myfile', (e) => {\n  if (e) {\n    console.error('myfile already exists');\n  } else {\n    open('myfile', 'wx', (err, fd) => {\n      if (err) throw err;\n\n      try {\n        writeMyData(fd);\n      } finally {\n        close(fd, (err) => {\n          if (err) throw err;\n        });\n      }\n    });\n  }\n});\n</code></pre>\n<p><strong>write (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\nopen('myfile', 'wx', (err, fd) => {\n  if (err) {\n    if (err.code === 'EEXIST') {\n      console.error('myfile already exists');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    writeMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p><strong>read (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close, exists } from 'node:fs';\n\nexists('myfile', (e) => {\n  if (e) {\n    open('myfile', 'r', (err, fd) => {\n      if (err) throw err;\n\n      try {\n        readMyData(fd);\n      } finally {\n        close(fd, (err) => {\n          if (err) throw err;\n        });\n      }\n    });\n  } else {\n    console.error('myfile does not exist');\n  }\n});\n</code></pre>\n<p><strong>read (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\n\nopen('myfile', 'r', (err, fd) => {\n  if (err) {\n    if (err.code === 'ENOENT') {\n      console.error('myfile does not exist');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    readMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p>The \"not recommended\" examples above check for existence and then use the\nfile; the \"recommended\" examples are better because they use the file directly\nand handle the error, if any.</p>\n<p>In general, check for the existence of a file only if the file won't be\nused directly, for example when its existence is a signal from another\nprocess.</p>"
            },
            {
              "textRaw": "`fs.fchmod(fd, mode, callback)`",
              "name": "fchmod",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the permissions on the file. No arguments other than a possible exception\nare given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchmod.2.html\"><code>fchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fchown(fd, uid, gid, callback)`",
              "name": "fchown",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the owner of the file. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchown.2.html\"><code>fchown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fdatasync(fd, callback)`",
              "name": "fdatasync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Forces all currently queued I/O operations associated with the file to the\noperating system's synchronized I/O completion state. Refer to the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a> documentation for details. No arguments other than a possible\nexception are given to the completion callback.</p>"
            },
            {
              "textRaw": "`fs.fstat(fd[, options], callback)`",
              "name": "fstat",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.95"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.Stats}",
                          "name": "stats",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Invokes the callback with the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the file descriptor.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fstat.2.html\"><code>fstat(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fsync(fd, callback)`",
              "name": "fsync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Request that all data for the open file descriptor is flushed to the storage\ndevice. The specific implementation is operating system and device specific.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a> documentation for more detail. No arguments other\nthan a possible exception are given to the completion callback.</p>"
            },
            {
              "textRaw": "`fs.ftruncate(fd[, len], callback)`",
              "name": "ftruncate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file descriptor. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/ftruncate.2.html\"><code>ftruncate(2)</code></a> documentation for more detail.</p>\n<p>If the file referred to by the file descriptor was larger than <code>len</code> bytes, only\nthe first <code>len</code> bytes will be retained in the file.</p>\n<p>For example, the following program retains only the first four bytes of the\nfile:</p>\n<pre><code class=\"language-mjs\">import { open, close, ftruncate } from 'node:fs';\n\nfunction closeFd(fd) {\n  close(fd, (err) => {\n    if (err) throw err;\n  });\n}\n\nopen('temp.txt', 'r+', (err, fd) => {\n  if (err) throw err;\n\n  try {\n    ftruncate(fd, 4, (err) => {\n      closeFd(fd);\n      if (err) throw err;\n    });\n  } catch (err) {\n    closeFd(fd);\n    if (err) throw err;\n  }\n});\n</code></pre>\n<p>If the file previously was shorter than <code>len</code> bytes, it is extended, and the\nextended part is filled with null bytes (<code>'\\0'</code>):</p>\n<p>If <code>len</code> is negative then <code>0</code> will be used.</p>"
            },
            {
              "textRaw": "`fs.futimes(fd, atime, mtime, callback)`",
              "name": "futimes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Change the file system timestamps of the object referenced by the supplied file\ndescriptor. See <a href=\"#fsutimespath-atime-mtime-callback\"><code>fs.utimes()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.glob(pattern[, options], callback)`",
              "name": "glob",
              "type": "method",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62695",
                    "description": "Add support for the `followSymlinks` option."
                  },
                  {
                    "version": [
                      "v24.1.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58182",
                    "description": "Add support for `URL` instances for `cwd` option."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56489",
                    "description": "Add support for `exclude` option to accept glob patterns."
                  },
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52837",
                    "description": "Add support for `withFileTypes` as an option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pattern` {string|string[]}",
                      "name": "pattern",
                      "type": "string|string[]"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} current working directory. **Default:** `process.cwd()`",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "current working directory."
                        },
                        {
                          "textRaw": "`exclude` {Function|string[]} Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it. **Default:** `undefined`.",
                          "name": "exclude",
                          "type": "Function|string[]",
                          "default": "`undefined`",
                          "desc": "Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it."
                        },
                        {
                          "textRaw": "`followSymlinks` {boolean} When `true`, symbolic links to directories are followed while expanding `**` patterns. **Default:** `false`.",
                          "name": "followSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, symbolic links to directories are followed while expanding `**` patterns."
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} `true` if the glob should return paths as Dirents, `false` otherwise. **Default:** `false`.",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if the glob should return paths as Dirents, `false` otherwise."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>When <code>followSymlinks</code> is enabled, detected symbolic link cycles are not\ntraversed recursively.</p>\n<pre><code class=\"language-mjs\">import { glob } from 'node:fs';\n\nglob('**/*.js', (err, matches) => {\n  if (err) throw err;\n  console.log(matches);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { glob } = require('node:fs');\n\nglob('**/*.js', (err, matches) => {\n  if (err) throw err;\n  console.log(matches);\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.lchmod(path, mode, callback)`",
              "name": "lchmod",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ],
                "deprecated": [
                  "v0.4.7"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer}",
                      "name": "mode",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the permissions on a symbolic link. No arguments other than a possible\nexception are given to the completion callback.</p>\n<p>This method is only implemented on macOS.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchmod.2.html\"><code>lchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.lchown(path, uid, gid, callback)`",
              "name": "lchown",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "This API is no longer deprecated."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Set the owner of the symbolic link. No arguments other than a possible\nexception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchown.2.html\"><code>lchown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.lutimes(path, atime, mtime, callback)`",
              "name": "lutimes",
              "type": "method",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the access and modification times of a file in the same way as\n<a href=\"#fsutimespath-atime-mtime-callback\"><code>fs.utimes()</code></a>, with the difference that if the path refers to a symbolic\nlink, then the link is not dereferenced: instead, the timestamps of the\nsymbolic link itself are changed.</p>\n<p>No arguments other than a possible exception are given to the completion\ncallback.</p>"
            },
            {
              "textRaw": "`fs.link(existingPath, newPath, callback)`",
              "name": "link",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `existingPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`existingPath` {string|Buffer|URL}",
                      "name": "existingPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new link from the <code>existingPath</code> to the <code>newPath</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a> documentation for more detail. No arguments other than a possible\nexception are given to the completion callback.</p>"
            },
            {
              "textRaw": "`fs.lstat(path[, options], callback)`",
              "name": "lstat",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.Stats}",
                          "name": "stats",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the symbolic link referred to by the path.\nThe callback gets two arguments <code>(err, stats)</code> where <code>stats</code> is a <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a>\nobject. <code>lstat()</code> is identical to <code>stat()</code>, except that if <code>path</code> is a symbolic\nlink, then the link itself is stat-ed, not the file that it refers to.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdir(path[, options], callback)`",
              "name": "mkdir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.8"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31530",
                    "description": "In `recursive` mode, the callback now receives the first created path as an argument."
                  },
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21875",
                    "description": "The second argument can now be an `options` object with `recursive` and `mode` properties."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object|integer}",
                      "name": "options",
                      "type": "Object|integer",
                      "options": [
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`mode` {string|integer} Not supported on Windows. See File modes for more details. **Default:** `0o777`.",
                          "name": "mode",
                          "type": "string|integer",
                          "default": "`0o777`",
                          "desc": "Not supported on Windows. See File modes for more details."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`path` {string|undefined} Present only if a directory is created with `recursive` set to `true`.",
                          "name": "path",
                          "type": "string|undefined",
                          "desc": "Present only if a directory is created with `recursive` set to `true`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously creates a directory.</p>\n<p>The callback is given a possible exception and, if <code>recursive</code> is <code>true</code>, the\nfirst directory path created, <code>(err[, path])</code>.\n<code>path</code> can still be <code>undefined</code> when <code>recursive</code> is <code>true</code>, if no directory was\ncreated (for instance, if it was previously created).</p>\n<p>The optional <code>options</code> argument can be an integer specifying <code>mode</code> (permission\nand sticky bits), or an object with a <code>mode</code> property and a <code>recursive</code>\nproperty indicating whether parent directories should be created. Calling\n<code>fs.mkdir()</code> when <code>path</code> is a directory that exists results in an error only\nwhen <code>recursive</code> is false. If <code>recursive</code> is false and the directory exists,\nan <code>EEXIST</code> error occurs.</p>\n<pre><code class=\"language-mjs\">import { mkdir } from 'node:fs';\n\n// Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist.\nmkdir('./tmp/a/apple', { recursive: true }, (err) => {\n  if (err) throw err;\n});\n</code></pre>\n<p>On Windows, using <code>fs.mkdir()</code> on the root directory even with recursion will\nresult in an error:</p>\n<pre><code class=\"language-mjs\">import { mkdir } from 'node:fs';\n\nmkdir('/', { recursive: true }, (err) => {\n  // => [Error: EPERM: operation not permitted, mkdir 'C:\\']\n});\n</code></pre>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/mkdir.2.html\"><code>mkdir(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdtemp(prefix[, options], callback)`",
              "name": "mkdtemp",
              "type": "method",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48828",
                    "description": "The `prefix` parameter now accepts buffers and URL."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v16.5.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39028",
                    "description": "The `prefix` parameter now accepts an empty string."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v6.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/6828",
                    "description": "The `callback` parameter is optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`directory` {string}",
                          "name": "directory",
                          "type": "string"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a unique temporary directory.</p>\n<p>Generates six random characters to be appended behind a required\n<code>prefix</code> to create a unique temporary directory. Due to platform\ninconsistencies, avoid trailing <code>X</code> characters in <code>prefix</code>. Some platforms,\nnotably the BSDs, can return more than six random characters, and replace\ntrailing <code>X</code> characters in <code>prefix</code> with random characters.</p>\n<p>The created directory path is passed as a string to the callback's second\nparameter.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>\n<pre><code class=\"language-mjs\">import { mkdtemp } from 'node:fs';\nimport { join } from 'node:path';\nimport { tmpdir } from 'node:os';\n\nmkdtemp(join(tmpdir(), 'foo-'), (err, directory) => {\n  if (err) throw err;\n  console.log(directory);\n  // Prints: /tmp/foo-itXde2 or C:\\Users\\...\\AppData\\Local\\Temp\\foo-itXde2\n});\n</code></pre>\n<p>The <code>fs.mkdtemp()</code> method will append the six randomly selected characters\ndirectly to the <code>prefix</code> string. For instance, given a directory <code>/tmp</code>, if the\nintention is to create a temporary directory <em>within</em> <code>/tmp</code>, the <code>prefix</code>\nmust end with a trailing platform-specific path separator\n(<code>require('node:path').sep</code>).</p>\n<pre><code class=\"language-mjs\">import { tmpdir } from 'node:os';\nimport { mkdtemp } from 'node:fs';\n\n// The parent directory for the new temporary directory\nconst tmpDir = tmpdir();\n\n// This method is *INCORRECT*:\nmkdtemp(tmpDir, (err, directory) => {\n  if (err) throw err;\n  console.log(directory);\n  // Will print something similar to `/tmpabc123`.\n  // A new temporary directory is created at the file system root\n  // rather than *within* the /tmp directory.\n});\n\n// This method is *CORRECT*:\nimport { sep } from 'node:path';\nmkdtemp(`${tmpDir}${sep}`, (err, directory) => {\n  if (err) throw err;\n  console.log(directory);\n  // Will print something similar to `/tmp/abc123`.\n  // A new temporary directory is created within\n  // the /tmp directory.\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.open(path[, flags[, mode]], callback)`",
              "name": "open",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v11.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23767",
                    "description": "The `flags` argument is now optional and defaults to `'r'`."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18801",
                    "description": "The `as` and `as+` flags are supported now."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`flags` {string|number} See support of file system `flags`. **Default:** `'r'`.",
                      "name": "flags",
                      "type": "string|number",
                      "default": "`'r'`",
                      "desc": "See support of file system `flags`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`mode` {string|integer} **Default:** `0o666` (readable and writable)",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666` (readable and writable)",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`fd` {integer}",
                          "name": "fd",
                          "type": "integer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous file open. See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a> documentation for more details.</p>\n<p><code>mode</code> sets the file mode (permission and sticky bits), but only if the file was\ncreated. On Windows, only the write permission can be manipulated; see\n<a href=\"#fschmodpath-mode-callback\"><code>fs.chmod()</code></a>.</p>\n<p>The callback gets two arguments <code>(err, fd)</code>.</p>\n<p>Some characters (<code>&#x3C; > : \" / \\ | ? *</code>) are reserved under Windows as documented\nby <a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file\">Naming Files, Paths, and Namespaces</a>. Under NTFS, if the filename contains\na colon, Node.js will open a file system stream, as described by\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams\">this MSDN page</a>.</p>\n<p>Functions based on <code>fs.open()</code> exhibit this behavior as well:\n<code>fs.writeFile()</code>, <code>fs.readFile()</code>, etc.</p>"
            },
            {
              "textRaw": "`fs.openAsBlob(path[, options])`",
              "name": "openAsBlob",
              "type": "method",
              "meta": {
                "added": [
                  "v19.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`type` {string} An optional mime type for the blob.",
                          "name": "type",
                          "type": "string",
                          "desc": "An optional mime type for the blob."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {Blob} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {Blob} upon success."
                  }
                }
              ],
              "desc": "<p>Returns a <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> whose data is backed by the given file.</p>\n<p>The file must not be modified after the <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> is created. Any modifications\nwill cause reading the <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> data to fail with a <code>DOMException</code> error.\nSynchronous stat operations on the file when the <code>Blob</code> is created, and before\neach read in order to detect whether the file data has been modified on disk.</p>\n<pre><code class=\"language-mjs\">import { openAsBlob } from 'node:fs';\n\nconst blob = await openAsBlob('the.file.txt');\nconst ab = await blob.arrayBuffer();\nblob.stream();\n</code></pre>\n<pre><code class=\"language-cjs\">const { openAsBlob } = require('node:fs');\n\n(async () => {\n  const blob = await openAsBlob('the.file.txt');\n  const ab = await blob.arrayBuffer();\n  blob.stream();\n})();\n</code></pre>"
            },
            {
              "textRaw": "`fs.opendir(path[, options], callback)`",
              "name": "opendir",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v13.1.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`bufferSize` {number} Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. **Default:** `32`",
                          "name": "bufferSize",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage."
                        },
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`dir` {fs.Dir}",
                          "name": "dir",
                          "type": "fs.Dir"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously open a directory. See the POSIX <a href=\"http://man7.org/linux/man-pages/man3/opendir.3.html\"><code>opendir(3)</code></a> documentation for\nmore details.</p>\n<p>Creates an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>, which contains all further functions for reading from\nand cleaning up the directory.</p>\n<p>The <code>encoding</code> option sets the encoding for the <code>path</code> while opening the\ndirectory and subsequent read operations.</p>"
            },
            {
              "textRaw": "`fs.read(fd, buffer, offset, length, position, callback)`",
              "name": "read",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray`, or a `DataView`."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `buffer` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4518",
                    "description": "The `length` parameter can now be `0`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} The buffer that the data will be written to.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "The buffer that the data will be written to."
                    },
                    {
                      "textRaw": "`offset` {integer} The position in `buffer` to write the data to.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "The position in `buffer` to write the data to."
                    },
                    {
                      "textRaw": "`length` {integer} The number of bytes to read.",
                      "name": "length",
                      "type": "integer",
                      "desc": "The number of bytes to read."
                    },
                    {
                      "textRaw": "`position` {integer|bigint|null} Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If `position` is a non-negative integer, the file position will be unchanged.",
                      "name": "position",
                      "type": "integer|bigint|null",
                      "desc": "Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If `position` is a non-negative integer, the file position will be unchanged."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer}",
                          "name": "buffer",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Read data from the file specified by <code>fd</code>.</p>\n<p>The callback is given the three arguments, <code>(err, bytesRead, buffer)</code>.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na promise for an <code>Object</code> with <code>bytesRead</code> and <code>buffer</code> properties.</p>\n<p>The <code>fs.read()</code> method reads data from the file specified\nby the file descriptor (<code>fd</code>).\nThe <code>length</code> argument indicates the maximum number\nof bytes that Node.js\nwill attempt to read from the kernel.\nHowever, the actual number of bytes read (<code>bytesRead</code>) can be lower\nthan the specified <code>length</code> for various reasons.</p>\n<p>For example:</p>\n<ul>\n<li>If the file is shorter than the specified <code>length</code>, <code>bytesRead</code>\nwill be set to the actual number of bytes read.</li>\n<li>If the file encounters EOF (End of File) before the buffer could\nbe filled, Node.js will read all available bytes until EOF is encountered,\nand the <code>bytesRead</code> parameter in the callback will indicate\nthe actual number of bytes read, which may be less than the specified <code>length</code>.</li>\n<li>If the file is on a slow network <code>filesystem</code>\nor encounters any other issue during reading,\n<code>bytesRead</code> can be lower than the specified <code>length</code>.</li>\n</ul>\n<p>Therefore, when using <code>fs.read()</code>, it's important to\ncheck the <code>bytesRead</code> value to\ndetermine how many bytes were actually read from the file.\nDepending on your application\nlogic, you may need to handle cases where <code>bytesRead</code>\nis lower than the specified <code>length</code>,\nsuch as by wrapping the read call in a loop if you require\na minimum amount of bytes.</p>\n<p>This behavior is similar to the POSIX <code>preadv2</code> function.</p>"
            },
            {
              "textRaw": "`fs.read(fd[, options], callback)`",
              "name": "read",
              "type": "method",
              "meta": {
                "added": [
                  "v13.11.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31402",
                    "description": "Options object can be passed in to make buffer, offset, length, and position optional."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView} **Default:** `Buffer.alloc(16384)`",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView",
                          "default": "`Buffer.alloc(16384)`"
                        },
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|bigint|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer}",
                          "name": "buffer",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Similar to the <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a> function, this version takes an optional\n<code>options</code> object. If no <code>options</code> object is specified, it will default with the\nabove values.</p>"
            },
            {
              "textRaw": "`fs.read(fd, buffer[, options], callback)`",
              "name": "read",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} The buffer that the data will be written to.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "The buffer that the data will be written to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|bigint} **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer}",
                          "name": "buffer",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Similar to the <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a> function, this version takes an optional\n<code>options</code> object. If no <code>options</code> object is specified, it will default with the\nabove values.</p>"
            },
            {
              "textRaw": "`fs.readdir(path[, options], callback)`",
              "name": "readdir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.8"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5616",
                    "description": "The `options` parameter was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} **Default:** `false`",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files and directories. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files and directories."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`files` {string[]|Buffer[]|fs.Dirent[]}",
                          "name": "files",
                          "type": "string[]|Buffer[]|fs.Dirent[]"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Reads the contents of a directory. The callback gets two arguments <code>(err, files)</code>\nwhere <code>files</code> is an array of the names of the files in the directory excluding\n<code>'.'</code> and <code>'..'</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe filenames passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe filenames returned will be passed as <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the <code>files</code> array will contain\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects.</p>"
            },
            {
              "textRaw": "`fs.readFile(path[, options], callback)`",
              "name": "readFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35911",
                    "description": "The options argument may include an AbortSignal to abort an ongoing readFile request."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v5.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3740",
                    "description": "The `callback` will always be called with `null` as the `error` parameter in case of success."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `path` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `null`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress readFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress readFile"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        },
                        {
                          "textRaw": "`data` {string|Buffer}",
                          "name": "data",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\nreadFile('/etc/passwd', (err, data) => {\n  if (err) throw err;\n  console.log(data);\n});\n</code></pre>\n<p>The callback is passed two arguments <code>(err, data)</code>, where <code>data</code> is the\ncontents of the file.</p>\n<p>If no encoding is specified, then the raw buffer is returned.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\nreadFile('/etc/passwd', 'utf8', callback);\n</code></pre>\n<p>When the path is a directory, the behavior of <code>fs.readFile()</code> and\n<a href=\"#fsreadfilesyncpath-options\"><code>fs.readFileSync()</code></a> is platform-specific. On macOS, Linux, and Windows, an\nerror will be returned. On FreeBSD, a representation of the directory's contents\nwill be returned.</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\n// macOS, Linux, and Windows\nreadFile('&#x3C;directory>', (err, data) => {\n  // => [Error: EISDIR: illegal operation on a directory, read &#x3C;directory>]\n});\n\n//  FreeBSD\nreadFile('&#x3C;directory>', (err, data) => {\n  // => null, &#x3C;data>\n});\n</code></pre>\n<p>It is possible to abort an ongoing request using an <code>AbortSignal</code>. If a\nrequest is aborted the callback is called with an <code>AbortError</code>:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\nconst controller = new AbortController();\nconst signal = controller.signal;\nreadFile(fileInfo[0].name, { signal }, (err, buf) => {\n  // ...\n});\n// When you want to abort the request\ncontroller.abort();\n</code></pre>\n<p>The <code>fs.readFile()</code> function buffers the entire file. To minimize memory costs,\nwhen possible prefer streaming via <code>fs.createReadStream()</code>.</p>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.readFile</code> performs.</p>",
              "modules": [
                {
                  "textRaw": "File descriptors",
                  "name": "file_descriptors",
                  "type": "module",
                  "desc": "<ol>\n<li>Any specified file descriptor has to support reading.</li>\n<li>If a file descriptor is specified as the <code>path</code>, it will not be closed\nautomatically.</li>\n<li>The reading will begin at the current position. For example, if the file\nalready had <code>'Hello World'</code> and six bytes are read with the file descriptor,\nthe call to <code>fs.readFile()</code> with the same file descriptor, would give\n<code>'World'</code>, rather than <code>'Hello World'</code>.</li>\n</ol>",
                  "displayName": "File descriptors"
                },
                {
                  "textRaw": "Performance Considerations",
                  "name": "performance_considerations",
                  "type": "module",
                  "desc": "<p>The <code>fs.readFile()</code> method asynchronously reads the contents of a file into\nmemory one chunk at a time, allowing the event loop to turn between each chunk.\nThis allows the read operation to have less impact on other activity that may\nbe using the underlying libuv thread pool but means that it will take longer\nto read a complete file into memory.</p>\n<p>The additional read overhead can vary broadly on different systems and depends\non the type of file being read. If the file type is not a regular file (a pipe\nfor instance) and Node.js is unable to determine an actual file size, each read\noperation will load on 64 KiB of data. For regular files, each read will process\n512 KiB of data.</p>\n<p>For applications that require as-fast-as-possible reading of file contents, it\nis better to use <code>fs.read()</code> directly and for application code to manage\nreading the full contents of the file itself.</p>\n<p>The Node.js GitHub issue <a href=\"https://github.com/nodejs/node/issues/25741\">#25741</a> provides more information and a detailed\nanalysis on the performance of <code>fs.readFile()</code> for multiple file sizes in\ndifferent Node.js versions.</p>",
                  "displayName": "Performance Considerations"
                }
              ]
            },
            {
              "textRaw": "`fs.readlink(path[, options], callback)`",
              "name": "readlink",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`linkString` {string|Buffer}",
                          "name": "linkString",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Reads the contents of the symbolic link referred to by <code>path</code>. The callback gets\ntwo arguments <code>(err, linkString)</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe link path passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe link path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>"
            },
            {
              "textRaw": "`fs.readv(fd, buffers[, position], callback)`",
              "name": "readv",
              "type": "method",
              "meta": {
                "added": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffers` {ArrayBufferView[]}",
                          "name": "buffers",
                          "type": "ArrayBufferView[]"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Read from a file specified by <code>fd</code> and write to an array of <code>ArrayBufferView</code>s\nusing <code>readv()</code>.</p>\n<p><code>position</code> is the offset from the beginning of the file from where data\nshould be read. If <code>typeof position !== 'number'</code>, the data will be read\nfrom the current position.</p>\n<p>The callback will be given three arguments: <code>err</code>, <code>bytesRead</code>, and\n<code>buffers</code>. <code>bytesRead</code> is how many bytes were read from the file.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na promise for an <code>Object</code> with <code>bytesRead</code> and <code>buffers</code> properties.</p>"
            },
            {
              "textRaw": "`fs.realpath(path[, options], callback)`",
              "name": "realpath",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13028",
                    "description": "Pipe/Socket resolve support was added."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v6.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7899",
                    "description": "Calling `realpath` now works again for various edge cases on Windows."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3594",
                    "description": "The `cache` parameter was removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`resolvedPath` {string|Buffer}",
                          "name": "resolvedPath",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously computes the canonical pathname by resolving <code>.</code>, <code>..</code>, and\nsymbolic links.</p>\n<p>A canonical pathname is not necessarily unique. Hard links and bind mounts can\nexpose a file system entity through many pathnames.</p>\n<p>This function behaves like <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a>, with some exceptions:</p>\n<ol>\n<li>\n<p>No case conversion is performed on case-insensitive file systems.</p>\n</li>\n<li>\n<p>The maximum number of symbolic links is platform-independent and generally\n(much) higher than what the native <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a> implementation supports.</p>\n</li>\n</ol>\n<p>The <code>callback</code> gets two arguments <code>(err, resolvedPath)</code>. May use <code>process.cwd</code>\nto resolve relative paths.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>If <code>path</code> resolves to a socket or a pipe, the function will return a system\ndependent name for that object.</p>\n<p>A path that does not exist results in an ENOENT error.\n<code>error.path</code> is the absolute file path.</p>"
            },
            {
              "textRaw": "`fs.realpath.native(path[, options], callback)`",
              "name": "native",
              "type": "method",
              "meta": {
                "added": [
                  "v9.2.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`resolvedPath` {string|Buffer}",
                          "name": "resolvedPath",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a>.</p>\n<p>The <code>callback</code> gets two arguments <code>(err, resolvedPath)</code>.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>On Linux, when Node.js is linked against musl libc, the procfs file system must\nbe mounted on <code>/proc</code> in order for this function to work. Glibc does not have\nthis restriction.</p>"
            },
            {
              "textRaw": "`fs.rename(oldPath, newPath, callback)`",
              "name": "rename",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `oldPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`oldPath` {string|Buffer|URL}",
                      "name": "oldPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously rename file at <code>oldPath</code> to the pathname provided\nas <code>newPath</code>. In the case that <code>newPath</code> already exists, it will\nbe overwritten. If there is a directory at <code>newPath</code>, an error will\nbe raised instead. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a>.</p>\n<pre><code class=\"language-mjs\">import { rename } from 'node:fs';\n\nrename('oldFile.txt', 'newFile.txt', (err) => {\n  if (err) throw err;\n  console.log('Rename complete!');\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.rmdir(path[, options], callback)`",
              "name": "rmdir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "Remove `recursive` option."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdir(path, { recursive: true })` on a `path` that is a file is no longer permitted and results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdir(path, { recursive: true })` on a `path` that does not exist is no longer permitted and results in a `ENOENT` error."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "The `recursive` option is deprecated, using it triggers a deprecation warning."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "The `recursive` option is deprecated, use `fs.rm` instead."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30644",
                    "description": "The `maxBusyTries` option is renamed to `maxRetries`, and its default is 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29168",
                    "description": "The `recursive`, `maxBusyTries`, and `emfileWait` options are now supported."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameters can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object} There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "name": "options",
                      "type": "Object",
                      "desc": "There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/rmdir.2.html\"><code>rmdir(2)</code></a>. No arguments other than a possible exception are given\nto the completion callback.</p>\n<p>Using <code>fs.rmdir()</code> on a file (not a directory) results in an <code>ENOENT</code> error on\nWindows and an <code>ENOTDIR</code> error on POSIX.</p>\n<p>To get a behavior similar to the <code>rm -rf</code> Unix command, use <a href=\"#fsrmpath-options-callback\"><code>fs.rm()</code></a>\nwith options <code>{ recursive: true, force: true }</code>.</p>"
            },
            {
              "textRaw": "`fs.rm(path[, options], callback)`",
              "name": "rm",
              "type": "method",
              "meta": {
                "added": [
                  "v14.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41132",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`force` {boolean} When `true`, exceptions will be ignored if `path` does not exist. **Default:** `false`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, exceptions will be ignored if `path` does not exist."
                        },
                        {
                          "textRaw": "`maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`. **Default:** `0`.",
                          "name": "maxRetries",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`."
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, perform a recursive removal. In recursive mode operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive removal. In recursive mode operations are retried on failure."
                        },
                        {
                          "textRaw": "`retryDelay` {integer} The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`.",
                          "name": "retryDelay",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously removes files and directories (modeled on the standard POSIX <code>rm</code>\nutility). No arguments other than a possible exception are given to the\ncompletion callback.</p>"
            },
            {
              "textRaw": "`fs.stat(path[, options], callback)`",
              "name": "stat",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61178",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.Stats}",
                          "name": "stats",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/stat.2.html\"><code>stat(2)</code></a>. The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is an <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object.</p>\n<p>In case of an error, the <code>err.code</code> will be one of <a href=\"errors.html#common-system-errors\">Common System Errors</a>.</p>\n<p><a href=\"#fsstatpath-options-callback\"><code>fs.stat()</code></a> follows symbolic links. Use <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a> to look at the\nlinks themselves.</p>\n<p>Using <code>fs.stat()</code> to check for the existence of a file before calling\n<code>fs.open()</code>, <code>fs.readFile()</code>, or <code>fs.writeFile()</code> is not recommended.\nInstead, user code should open/read/write the file directly and handle the\nerror raised if the file is not available.</p>\n<p>To check if a file exists without manipulating it afterwards, <a href=\"#fsaccesspath-mode-callback\"><code>fs.access()</code></a>\nis recommended.</p>\n<p>For example, given the following directory structure:</p>\n<pre><code class=\"language-text\">- txtDir\n-- file.txt\n- app.js\n</code></pre>\n<p>The next program will check for the stats of the given paths:</p>\n<pre><code class=\"language-mjs\">import { stat } from 'node:fs';\n\nconst pathsToCheck = ['./txtDir', './txtDir/file.txt'];\n\nfor (let i = 0; i &#x3C; pathsToCheck.length; i++) {\n  stat(pathsToCheck[i], (err, stats) => {\n    console.log(stats.isDirectory());\n    console.log(stats);\n  });\n}\n</code></pre>\n<p>The resulting output will resemble:</p>\n<pre><code class=\"language-console\">true\nStats {\n  dev: 16777220,\n  mode: 16877,\n  nlink: 3,\n  uid: 501,\n  gid: 20,\n  rdev: 0,\n  blksize: 4096,\n  ino: 14214262,\n  size: 96,\n  blocks: 0,\n  atimeMs: 1561174653071.963,\n  mtimeMs: 1561174614583.3518,\n  ctimeMs: 1561174626623.5366,\n  birthtimeMs: 1561174126937.2893,\n  atime: 2019-06-22T03:37:33.072Z,\n  mtime: 2019-06-22T03:36:54.583Z,\n  ctime: 2019-06-22T03:37:06.624Z,\n  birthtime: 2019-06-22T03:28:46.937Z,\n  atimeInstant: 2019-06-22T03:37:33.071963Z,\n  mtimeInstant: 2019-06-22T03:36:54.5833518Z,\n  ctimeInstant: 2019-06-22T03:37:06.6235366Z,\n  birthtimeInstant: 2019-06-22T03:28:46.9372893Z\n}\nfalse\nStats {\n  dev: 16777220,\n  mode: 33188,\n  nlink: 1,\n  uid: 501,\n  gid: 20,\n  rdev: 0,\n  blksize: 4096,\n  ino: 14214074,\n  size: 8,\n  blocks: 8,\n  atimeMs: 1561174616618.8555,\n  mtimeMs: 1561174614584,\n  ctimeMs: 1561174614583.8145,\n  birthtimeMs: 1561174007710.7478,\n  atime: 2019-06-22T03:36:56.619Z,\n  mtime: 2019-06-22T03:36:54.584Z,\n  ctime: 2019-06-22T03:36:54.584Z,\n  birthtime: 2019-06-22T03:26:47.711Z,\n  atimeInstant: 2019-06-22T03:36:56.6188555Z,\n  mtimeInstant: 2019-06-22T03:36:54.584Z,\n  ctimeInstant: 2019-06-22T03:36:54.5838145Z,\n  birthtimeInstant: 2019-06-22T03:26:47.7107478Z\n}\n</code></pre>"
            },
            {
              "textRaw": "`fs.statfs(path[, options], callback)`",
              "name": "statfs",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.StatFs} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.StatFs} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.StatFs}",
                          "name": "stats",
                          "type": "fs.StatFs"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/statfs.2.html\"><code>statfs(2)</code></a>. Returns information about the mounted file system which\ncontains <code>path</code>. The callback gets two arguments <code>(err, stats)</code> where <code>stats</code> is an <a href=\"fs.html#class-fsstatfs\"><code>&#x3C;fs.StatFs></code></a> object.</p>\n<p>In case of an error, the <code>err.code</code> will be one of <a href=\"errors.html#common-system-errors\">Common System Errors</a>.</p>"
            },
            {
              "textRaw": "`fs.symlink(target, path[, type], callback)`",
              "name": "symlink",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23724",
                    "description": "If the `type` argument is left undefined, Node will autodetect `target` type and automatically select `dir` or `file`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `target` and `path` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {string|Buffer|URL}",
                      "name": "target",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`type` {string|null} **Default:** `null`",
                      "name": "type",
                      "type": "string|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates the link called <code>path</code> pointing to <code>target</code>. No arguments other than a\npossible exception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/symlink.2.html\"><code>symlink(2)</code></a> documentation for more details.</p>\n<p>The <code>type</code> argument is only available on Windows and ignored on other platforms.\nIt can be set to <code>'dir'</code>, <code>'file'</code>, or <code>'junction'</code>. If the <code>type</code> argument is\n<code>null</code>, Node.js will autodetect <code>target</code> type and use <code>'file'</code> or <code>'dir'</code>.\nIf the <code>target</code> does not exist, <code>'file'</code> will be used. Windows junction points\nrequire the destination path to be absolute. When using <code>'junction'</code>, the\n<code>target</code> argument will automatically be normalized to absolute path. Junction\npoints on NTFS volumes can only point to directories.</p>\n<p>Relative targets are relative to the link's parent directory.</p>\n<pre><code class=\"language-mjs\">import { symlink } from 'node:fs';\n\nsymlink('./mew', './mewtwo', callback);\n</code></pre>\n<p>The above example creates a symbolic link <code>mewtwo</code> which points to <code>mew</code> in the\nsame directory:</p>\n<pre><code class=\"language-bash\">$ tree .\n.\n├── mew\n└── mewtwo -> ./mew\n</code></pre>"
            },
            {
              "textRaw": "`fs.truncate(path[, len], callback)`",
              "name": "truncate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file. No arguments other than a possible exception are\ngiven to the completion callback. A file descriptor can also be passed as the\nfirst argument. In this case, <code>fs.ftruncate()</code> is called.</p>\n<pre><code class=\"language-mjs\">import { truncate } from 'node:fs';\n// Assuming that 'path/file.txt' is a regular file.\ntruncate('path/file.txt', (err) => {\n  if (err) throw err;\n  console.log('path/file.txt was truncated');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { truncate } = require('node:fs');\n// Assuming that 'path/file.txt' is a regular file.\ntruncate('path/file.txt', (err) => {\n  if (err) throw err;\n  console.log('path/file.txt was truncated');\n});\n</code></pre>\n<p>Passing a file descriptor is deprecated and may result in an error being thrown\nin the future.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/truncate.2.html\"><code>truncate(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.unlink(path, callback)`",
              "name": "unlink",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously removes a file or symbolic link. No arguments other than a\npossible exception are given to the completion callback.</p>\n<pre><code class=\"language-mjs\">import { unlink } from 'node:fs';\n// Assuming that 'path/file.txt' is a regular file.\nunlink('path/file.txt', (err) => {\n  if (err) throw err;\n  console.log('path/file.txt was deleted');\n});\n</code></pre>\n<p><code>fs.unlink()</code> will not work on a directory, empty or otherwise. To remove a\ndirectory, use <a href=\"#fsrmdirpath-options-callback\"><code>fs.rmdir()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.unwatchFile(filename[, listener])`",
              "name": "unwatchFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`listener` {Function} Optional, a listener previously attached using `fs.watchFile()`",
                      "name": "listener",
                      "type": "Function",
                      "desc": "Optional, a listener previously attached using `fs.watchFile()`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Stop watching for changes on <code>filename</code>. If <code>listener</code> is specified, only that\nparticular listener is removed. Otherwise, <em>all</em> listeners are removed,\neffectively stopping watching of <code>filename</code>.</p>\n<p>Calling <code>fs.unwatchFile()</code> with a filename that is not being watched is a\nno-op, not an error.</p>\n<p>Using <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a> is more efficient than <code>fs.watchFile()</code> and\n<code>fs.unwatchFile()</code>. <code>fs.watch()</code> should be used instead of <code>fs.watchFile()</code>\nand <code>fs.unwatchFile()</code> when possible.</p>"
            },
            {
              "textRaw": "`fs.utimes(path, atime, mtime, callback)`",
              "name": "utimes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11919",
                    "description": "`NaN`, `Infinity`, and `-Infinity` are no longer valid time specifiers."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Change the file system timestamps of the object referenced by <code>path</code>.</p>\n<p>The <code>atime</code> and <code>mtime</code> arguments follow these rules:</p>\n<ul>\n<li>Values can be either numbers representing Unix epoch time in seconds,\n<code>Date</code>s, or a numeric string like <code>'123456789.0'</code>.</li>\n<li>If the value can not be converted to a number, or is <code>NaN</code>, <code>Infinity</code>, or\n<code>-Infinity</code>, an <code>Error</code> will be thrown.</li>\n</ul>"
            },
            {
              "textRaw": "`fs.watch(filename[, options][, listener])`",
              "name": "watch",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61870",
                    "description": "Added `throwIfNoEntry` option."
                  },
                  {
                    "version": "v19.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/45098",
                    "description": "Added recursive support for Linux, AIX and IBMi."
                  },
                  {
                    "version": [
                      "v15.9.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37190",
                    "description": "Added support for closing the watcher with an AbortSignal."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `filename` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`persistent` {boolean} Indicates whether the process should continue to run as long as files are being watched. **Default:** `true`.",
                          "name": "persistent",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Indicates whether the process should continue to run as long as files are being watched."
                        },
                        {
                          "textRaw": "`recursive` {boolean} Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats). **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats)."
                        },
                        {
                          "textRaw": "`encoding` {string} Specifies the character encoding to be used for the filename passed to the listener. **Default:** `'utf8'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "Specifies the character encoding to be used for the filename passed to the listener."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows closing the watcher with an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows closing the watcher with an AbortSignal."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Indicates whether an exception should be thrown when the path does not exist. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Indicates whether an exception should be thrown when the path does not exist."
                        },
                        {
                          "textRaw": "`ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore. **Default:** `undefined`.",
                          "name": "ignore",
                          "type": "string|RegExp|Function|Array",
                          "default": "`undefined`",
                          "desc": "Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`listener` {Function|undefined} **Default:** `undefined`",
                      "name": "listener",
                      "type": "Function|undefined",
                      "default": "`undefined`",
                      "options": [
                        {
                          "textRaw": "`eventType` {string}",
                          "name": "eventType",
                          "type": "string"
                        },
                        {
                          "textRaw": "`filename` {string|Buffer|null}",
                          "name": "filename",
                          "type": "string|Buffer|null"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.FSWatcher}",
                    "name": "return",
                    "type": "fs.FSWatcher"
                  }
                }
              ],
              "desc": "<p>Watch for changes on <code>filename</code>, where <code>filename</code> is either a file or a\ndirectory.</p>\n<p>The second argument is optional. If <code>options</code> is provided as a string, it\nspecifies the <code>encoding</code>. Otherwise <code>options</code> should be passed as an object.</p>\n<p>The listener callback gets two arguments <code>(eventType, filename)</code>. <code>eventType</code>\nis either <code>'rename'</code> or <code>'change'</code>, and <code>filename</code> is the name of the file\nwhich triggered the event.</p>\n<p>On most platforms, <code>'rename'</code> is emitted whenever a filename appears or\ndisappears in the directory.</p>\n<p>The listener callback is attached to the <code>'change'</code> event fired by\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>, but it is not the same thing as the <code>'change'</code> value of\n<code>eventType</code>.</p>\n<p>If a <code>signal</code> is passed, aborting the corresponding AbortController will close\nthe returned <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>.</p>",
              "miscs": [
                {
                  "textRaw": "Caveats",
                  "name": "Caveats",
                  "type": "misc",
                  "desc": "<p>The <code>fs.watch</code> API is not 100% consistent across platforms, and is\nunavailable in some situations.</p>\n<p>On Windows, no events will be emitted if the watched directory is moved or\nrenamed. An <code>EPERM</code> error is reported when the watched directory is deleted.</p>\n<p>The <code>fs.watch</code> API does not provide any protection with respect\nto malicious actions on the file system. For example, on Windows it is\nimplemented by monitoring changes in a directory versus specific files. This\nallows substitution of a file and fs reporting changes on the new file\nwith the same filename.</p>",
                  "miscs": [
                    {
                      "textRaw": "Availability",
                      "name": "Availability",
                      "type": "misc",
                      "desc": "<p>This feature depends on the underlying operating system providing a way\nto be notified of file system changes.</p>\n<ul>\n<li>On Linux systems, this uses <a href=\"https://man7.org/linux/man-pages/man7/inotify.7.html\"><code>inotify(7)</code></a>.</li>\n<li>On BSD systems, this uses <a href=\"https://www.freebsd.org/cgi/man.cgi?query=kqueue&#x26;sektion=2\"><code>kqueue(2)</code></a>.</li>\n<li>On macOS, this uses <a href=\"https://www.freebsd.org/cgi/man.cgi?query=kqueue&#x26;sektion=2\"><code>kqueue(2)</code></a> for files and <a href=\"https://developer.apple.com/documentation/coreservices/file_system_events\"><code>FSEvents</code></a> for\ndirectories.</li>\n<li>On SunOS systems (including Solaris and SmartOS), this uses <a href=\"https://illumos.org/man/port_create\"><code>event ports</code></a>.</li>\n<li>On Windows systems, this feature depends on <a href=\"https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-readdirectorychangesw\"><code>ReadDirectoryChangesW</code></a>.</li>\n<li>On AIX systems, this feature depends on <a href=\"https://developer.ibm.com/articles/au-aix_event_infrastructure/\"><code>AHAFS</code></a>, which must be enabled.</li>\n<li>On IBM i systems, this feature is not supported.</li>\n</ul>\n<p>If the underlying functionality is not available for some reason, then\n<code>fs.watch()</code> will not be able to function and may throw an exception.\nFor example, watching files or directories can be unreliable, and in some\ncases impossible, on network file systems (NFS, SMB, etc) or host file systems\nwhen using virtualization software such as Vagrant or Docker.</p>\n<p>It is still possible to use <code>fs.watchFile()</code>, which uses stat polling, but\nthis method is slower and less reliable.</p>"
                    },
                    {
                      "textRaw": "Inodes",
                      "name": "Inodes",
                      "type": "misc",
                      "desc": "<p>On Linux and macOS systems, <code>fs.watch()</code> resolves the path to an <a href=\"https://en.wikipedia.org/wiki/Inode\">inode</a> and\nwatches the inode. If the watched path is deleted and recreated, it is assigned\na new inode. The watch will emit an event for the delete but will continue\nwatching the <em>original</em> inode. Events for the new inode will not be emitted.\nThis is expected behavior.</p>\n<p>AIX files retain the same inode for the lifetime of a file. Saving and closing a\nwatched file on AIX will result in two notifications (one for adding new\ncontent, and one for truncation).</p>"
                    },
                    {
                      "textRaw": "Filename argument",
                      "name": "Filename argument",
                      "type": "misc",
                      "desc": "<p>Providing <code>filename</code> argument in the callback is only supported on Linux,\nmacOS, Windows, and AIX. Even on supported platforms, <code>filename</code> is not always\nguaranteed to be provided. Therefore, don't assume that <code>filename</code> argument is\nalways provided in the callback, and have some fallback logic if it is <code>null</code>.</p>\n<pre><code class=\"language-mjs\">import { watch } from 'node:fs';\nwatch('somedir', (eventType, filename) => {\n  console.log(`event type is: ${eventType}`);\n  if (filename) {\n    console.log(`filename provided: ${filename}`);\n  } else {\n    console.log('filename not provided');\n  }\n});\n</code></pre>"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`fs.watchFile(filename[, options], listener)`",
              "name": "watchFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "The `bigint` option is now supported."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `filename` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} **Default:** `false`",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`persistent` {boolean} **Default:** `true`",
                          "name": "persistent",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`interval` {integer} **Default:** `5007`",
                          "name": "interval",
                          "type": "integer",
                          "default": "`5007`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`current` {fs.Stats}",
                          "name": "current",
                          "type": "fs.Stats"
                        },
                        {
                          "textRaw": "`previous` {fs.Stats}",
                          "name": "previous",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.StatWatcher}",
                    "name": "return",
                    "type": "fs.StatWatcher"
                  }
                }
              ],
              "desc": "<p>Watch for changes on <code>filename</code>. The callback <code>listener</code> will be called each\ntime the file is accessed.</p>\n<p>The <code>options</code> argument may be omitted. If provided, it should be an object. The\n<code>options</code> object may contain a boolean named <code>persistent</code> that indicates\nwhether the process should continue to run as long as files are being watched.\nThe <code>options</code> object may specify an <code>interval</code> property indicating how often the\ntarget should be polled in milliseconds.</p>\n<p>The <code>listener</code> gets two arguments the current stat object and the previous\nstat object:</p>\n<pre><code class=\"language-mjs\">import { watchFile } from 'node:fs';\n\nwatchFile('message.text', (curr, prev) => {\n  console.log(`the current mtime is: ${curr.mtime}`);\n  console.log(`the previous mtime was: ${prev.mtime}`);\n});\n</code></pre>\n<p>These stat objects are instances of <code>fs.Stat</code>. If the <code>bigint</code> option is <code>true</code>,\nthe numeric values in these objects are specified as <code>BigInt</code>s.</p>\n<p>To be notified when the file was modified, not just accessed, it is necessary\nto compare <code>curr.mtimeMs</code> and <code>prev.mtimeMs</code>.</p>\n<p>When an <code>fs.watchFile</code> operation results in an <code>ENOENT</code> error, it\nwill invoke the listener once, with all the fields zeroed (or, for dates, the\nUnix Epoch). If the file is created later on, the listener will be called\nagain, with the latest stat objects. This is a change in functionality since\nv0.10.</p>\n<p>Using <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a> is more efficient than <code>fs.watchFile</code> and\n<code>fs.unwatchFile</code>. <code>fs.watch</code> should be used instead of <code>fs.watchFile</code> and\n<code>fs.unwatchFile</code> when possible.</p>\n<p>When a file being watched by <code>fs.watchFile()</code> disappears and reappears,\nthen the contents of <code>previous</code> in the second callback event (the file's\nreappearance) will be the same as the contents of <code>previous</code> in the first\ncallback event (its disappearance).</p>\n<p>This happens when:</p>\n<ul>\n<li>the file is deleted, followed by a restore</li>\n<li>the file is renamed and then renamed a second time back to its original name</li>\n</ul>"
            },
            {
              "textRaw": "`fs.write(fd, buffer, offset[, length[, position]], callback)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `buffer` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `buffer` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `offset` and `length` parameters are optional now."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`offset` {integer} **Default:** `0`",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`"
                    },
                    {
                      "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                      "name": "length",
                      "type": "integer",
                      "default": "`buffer.byteLength - offset`",
                      "optional": true
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesWritten` {integer}",
                          "name": "bytesWritten",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write <code>buffer</code> to the file specified by <code>fd</code>.</p>\n<p><code>offset</code> determines the part of the buffer to be written, and <code>length</code> is\nan integer specifying the number of bytes to write.</p>\n<p><code>position</code> refers to the offset from the beginning of the file where this data\nshould be written. If <code>typeof position !== 'number'</code>, the data will be written\nat the current position. See <a href=\"http://man7.org/linux/man-pages/man2/pwrite.2.html\"><code>pwrite(2)</code></a>.</p>\n<p>The callback will be given three arguments <code>(err, bytesWritten, buffer)</code> where\n<code>bytesWritten</code> specifies how many <em>bytes</em> were written from <code>buffer</code>.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na promise for an <code>Object</code> with <code>bytesWritten</code> and <code>buffer</code> properties.</p>\n<p>It is unsafe to use <code>fs.write()</code> multiple times on the same file without waiting\nfor the callback. For this scenario, <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
            },
            {
              "textRaw": "`fs.write(fd, buffer[, options], callback)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesWritten` {integer}",
                          "name": "bytesWritten",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write <code>buffer</code> to the file specified by <code>fd</code>.</p>\n<p>Similar to the above <code>fs.write</code> function, this version takes an\noptional <code>options</code> object. If no <code>options</code> object is specified, it will\ndefault with the above values.</p>"
            },
            {
              "textRaw": "`fs.write(fd, string[, position[, encoding]], callback)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is no longer supported."
                  },
                  {
                    "version": "v17.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is deprecated."
                  },
                  {
                    "version": "v14.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34993",
                    "description": "The `string` parameter will stringify an object with an explicit `toString` function."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `string` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `position` parameter is optional now."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`string` {string}",
                      "name": "string",
                      "type": "string"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`written` {integer}",
                          "name": "written",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`string` {string}",
                          "name": "string",
                          "type": "string"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write <code>string</code> to the file specified by <code>fd</code>. If <code>string</code> is not a string,\nan exception is thrown.</p>\n<p><code>position</code> refers to the offset from the beginning of the file where this data\nshould be written. If <code>typeof position !== 'number'</code> the data will be written at\nthe current position. See <a href=\"http://man7.org/linux/man-pages/man2/pwrite.2.html\"><code>pwrite(2)</code></a>.</p>\n<p><code>encoding</code> is the expected string encoding.</p>\n<p>The callback will receive the arguments <code>(err, written, string)</code> where <code>written</code>\nspecifies how many <em>bytes</em> the passed string required to be written. Bytes\nwritten is not necessarily the same as string characters written. See\n<a href=\"buffer.html#static-method-bufferbytelengthstring-encoding\"><code>Buffer.byteLength</code></a>.</p>\n<p>It is unsafe to use <code>fs.write()</code> multiple times on the same file without waiting\nfor the callback. For this scenario, <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>\n<p>On Windows, if the file descriptor is connected to the console (e.g. <code>fd == 1</code>\nor <code>stdout</code>) a string containing non-ASCII characters will not be rendered\nproperly by default, regardless of the encoding used.\nIt is possible to configure the console to render UTF-8 properly by changing the\nactive codepage with the <code>chcp 65001</code> command. See the <a href=\"https://ss64.com/nt/chcp.html\">chcp</a> docs for more\ndetails.</p>"
            },
            {
              "textRaw": "`fs.writeFile(file, data[, options], callback)`",
              "name": "writeFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50009",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is no longer supported."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v17.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is deprecated."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35993",
                    "description": "The options argument may include an AbortSignal to abort an ongoing writeFile request."
                  },
                  {
                    "version": "v14.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34993",
                    "description": "The `data` parameter will stringify an object with an explicit `toString` function."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `data` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `data` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "file",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If all data is successfully written to the file, and `flush` is `true`, `fs.fsync()` is used to flush the data. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If all data is successfully written to the file, and `flush` is `true`, `fs.fsync()` is used to flush the data."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress writeFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress writeFile"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>When <code>file</code> is a filename, asynchronously writes data to the file, replacing the\nfile if it already exists. <code>data</code> can be a string or a buffer.</p>\n<p>When <code>file</code> is a file descriptor, the behavior is similar to calling\n<code>fs.write()</code> directly (which is recommended). See the notes below on using\na file descriptor.</p>\n<p>The <code>encoding</code> option is ignored if <code>data</code> is a buffer.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nconst data = new Uint8Array(Buffer.from('Hello Node.js'));\nwriteFile('message.txt', data, (err) => {\n  if (err) throw err;\n  console.log('The file has been saved!');\n});\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs';\n\nwriteFile('message.txt', 'Hello Node.js', 'utf8', callback);\n</code></pre>\n<p>It is unsafe to use <code>fs.writeFile()</code> multiple times on the same file without\nwaiting for the callback. For this scenario, <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>\n<p>Similarly to <code>fs.readFile</code> - <code>fs.writeFile</code> is a convenience method that\nperforms multiple <code>write</code> calls internally to write the buffer passed to it.\nFor performance sensitive code consider using <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>.</p>\n<p>It is possible to use an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> to cancel an <code>fs.writeFile()</code>.\nCancelation is \"best effort\", and some amount of data is likely still\nto be written.</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nconst controller = new AbortController();\nconst { signal } = controller;\nconst data = new Uint8Array(Buffer.from('Hello Node.js'));\nwriteFile('message.txt', data, { signal }, (err) => {\n  // When a request is aborted - the callback is called with an AbortError\n});\n// When the request should be aborted\ncontroller.abort();\n</code></pre>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.writeFile</code> performs.</p>",
              "modules": [
                {
                  "textRaw": "Using `fs.writeFile()` with file descriptors",
                  "name": "using_`fs.writefile()`_with_file_descriptors",
                  "type": "module",
                  "desc": "<p>When <code>file</code> is a file descriptor, the behavior is almost identical to directly\ncalling <code>fs.write()</code> like:</p>\n<pre><code class=\"language-mjs\">import { write } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nwrite(fd, Buffer.from(data, options.encoding), callback);\n</code></pre>\n<p>The difference from directly calling <code>fs.write()</code> is that under some unusual\nconditions, <code>fs.write()</code> might write only part of the buffer and need to be\nretried to write the remaining data, whereas <code>fs.writeFile()</code> retries until\nthe data is entirely written (or an error occurs).</p>\n<p>The implications of this are a common source of confusion. In\nthe file descriptor case, the file is not replaced! The data is not necessarily\nwritten to the beginning of the file, and the file's original data may remain\nbefore and/or after the newly written data.</p>\n<p>For example, if <code>fs.writeFile()</code> is called twice in a row, first to write the\nstring <code>'Hello'</code>, then to write the string <code>', World'</code>, the file would contain\n<code>'Hello, World'</code>, and might contain some of the file's original data (depending\non the size of the original file, and the position of the file descriptor). If\na file name had been used instead of a descriptor, the file would be guaranteed\nto contain only <code>', World'</code>.</p>",
                  "displayName": "Using `fs.writeFile()` with file descriptors"
                }
              ]
            },
            {
              "textRaw": "`fs.writev(fd, buffers[, position], callback)`",
              "name": "writev",
              "type": "method",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesWritten` {integer}",
                          "name": "bytesWritten",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffers` {ArrayBufferView[]}",
                          "name": "buffers",
                          "type": "ArrayBufferView[]"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write an array of <code>ArrayBufferView</code>s to the file specified by <code>fd</code> using\n<code>writev()</code>.</p>\n<p><code>position</code> is the offset from the beginning of the file where this data\nshould be written. If <code>typeof position !== 'number'</code>, the data will be written\nat the current position.</p>\n<p>The callback will be given three arguments: <code>err</code>, <code>bytesWritten</code>, and\n<code>buffers</code>. <code>bytesWritten</code> is how many bytes were written from <code>buffers</code>.</p>\n<p>If this method is <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed, it returns a promise for an\n<code>Object</code> with <code>bytesWritten</code> and <code>buffers</code> properties.</p>\n<p>It is unsafe to use <code>fs.writev()</code> multiple times on the same file without\nwaiting for the callback. For this scenario, use <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
            }
          ],
          "displayName": "Callback API"
        },
        {
          "textRaw": "Synchronous API",
          "name": "synchronous_api",
          "type": "module",
          "desc": "<p>The synchronous APIs perform all operations synchronously, blocking the\nevent loop until the operation completes or fails.</p>",
          "methods": [
            {
              "textRaw": "`fs.accessSync(path[, mode])`",
              "name": "accessSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer} **Default:** `fs.constants.F_OK`",
                      "name": "mode",
                      "type": "integer",
                      "default": "`fs.constants.F_OK`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously tests a user's permissions for the file or directory specified\nby <code>path</code>. The <code>mode</code> argument is an optional integer that specifies the\naccessibility checks to be performed. <code>mode</code> should be either the value\n<code>fs.constants.F_OK</code> or a mask consisting of the bitwise OR of any of\n<code>fs.constants.R_OK</code>, <code>fs.constants.W_OK</code>, and <code>fs.constants.X_OK</code> (e.g.\n<code>fs.constants.W_OK | fs.constants.R_OK</code>). Check <a href=\"#file-access-constants\">File access constants</a> for\npossible values of <code>mode</code>.</p>\n<p>If any of the accessibility checks fail, an <code>Error</code> will be thrown. Otherwise,\nthe method will return <code>undefined</code>.</p>\n<pre><code class=\"language-mjs\">import { accessSync, constants } from 'node:fs';\n\ntry {\n  accessSync('etc/passwd', constants.R_OK | constants.W_OK);\n  console.log('can read/write');\n} catch (err) {\n  console.error('no access!');\n}\n</code></pre>"
            },
            {
              "textRaw": "`fs.appendFileSync(path, data[, options])`",
              "name": "appendFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50095",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|number} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|number",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'a'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'a'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously append data to a file, creating the file if it does not yet\nexist. <code>data</code> can be a string or a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<pre><code class=\"language-mjs\">import { appendFileSync } from 'node:fs';\n\ntry {\n  appendFileSync('message.txt', 'data to append');\n  console.log('The \"data to append\" was appended to file!');\n} catch (err) {\n  /* Handle the error */\n}\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { appendFileSync } from 'node:fs';\n\nappendFileSync('message.txt', 'data to append', 'utf8');\n</code></pre>\n<p>The <code>path</code> may be specified as a numeric file descriptor that has been opened\nfor appending (using <code>fs.open()</code> or <code>fs.openSync()</code>). The file descriptor will\nnot be closed automatically.</p>\n<pre><code class=\"language-mjs\">import { openSync, closeSync, appendFileSync } from 'node:fs';\n\nlet fd;\n\ntry {\n  fd = openSync('message.txt', 'a');\n  appendFileSync(fd, 'data to append', 'utf8');\n} catch (err) {\n  /* Handle the error */\n} finally {\n  if (fd !== undefined)\n    closeSync(fd);\n}\n</code></pre>"
            },
            {
              "textRaw": "`fs.chmodSync(path, mode)`",
              "name": "chmodSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ]
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fschmodpath-mode-callback\"><code>fs.chmod()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.chownSync(path, uid, gid)`",
              "name": "chownSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.97"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously changes owner and group of a file. Returns <code>undefined</code>.\nThis is the synchronous version of <a href=\"#fschownpath-uid-gid-callback\"><code>fs.chown()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.closeSync(fd)`",
              "name": "closeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Closes the file descriptor. Returns <code>undefined</code>.</p>\n<p>Calling <code>fs.closeSync()</code> on any file descriptor (<code>fd</code>) that is currently in use\nthrough any other <code>fs</code> operation may lead to undefined behavior.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/close.2.html\"><code>close(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.copyFileSync(src, dest[, mode])`",
              "name": "copyFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27044",
                    "description": "Changed `flags` argument to `mode` and imposed stricter type validation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|Buffer|URL} source filename to copy",
                      "name": "src",
                      "type": "string|Buffer|URL",
                      "desc": "source filename to copy"
                    },
                    {
                      "textRaw": "`dest` {string|Buffer|URL} destination filename of the copy operation",
                      "name": "dest",
                      "type": "string|Buffer|URL",
                      "desc": "destination filename of the copy operation"
                    },
                    {
                      "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`.",
                      "name": "mode",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "modifiers for copy operation.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists. Returns <code>undefined</code>. Node.js makes no guarantees about the\natomicity of the copy operation. If an error occurs after the destination file\nhas been opened for writing, Node.js will attempt to remove the destination.</p>\n<p><code>mode</code> is an optional integer that specifies the behavior\nof the copy operation. It is possible to create a mask consisting of the bitwise\nOR of two or more values (e.g.\n<code>fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE</code>).</p>\n<ul>\n<li><code>fs.constants.COPYFILE_EXCL</code>: The copy operation will fail if <code>dest</code> already\nexists.</li>\n<li><code>fs.constants.COPYFILE_FICLONE</code>: The copy operation will attempt to create a\ncopy-on-write reflink. If the platform does not support copy-on-write, then a\nfallback copy mechanism is used.</li>\n<li><code>fs.constants.COPYFILE_FICLONE_FORCE</code>: The copy operation will attempt to\ncreate a copy-on-write reflink. If the platform does not support\ncopy-on-write, then the operation will fail.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { copyFileSync, constants } from 'node:fs';\n\n// destination.txt will be created or overwritten by default.\ncopyFileSync('source.txt', 'destination.txt');\nconsole.log('source.txt was copied to destination.txt');\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\ncopyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL);\n</code></pre>"
            },
            {
              "textRaw": "`fs.cpSync(src, dest[, options])`",
              "name": "cpSync",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53127",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47084",
                    "description": "Accept an additional `mode` option to specify the copy behavior as the `mode` argument of `fs.copyFile()`."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41819",
                    "description": "Accepts an additional `verbatimSymlinks` option to specify whether to perform path resolution for symlinks."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|URL} source path to copy.",
                      "name": "src",
                      "type": "string|URL",
                      "desc": "source path to copy."
                    },
                    {
                      "textRaw": "`dest` {string|URL} destination path to copy to.",
                      "name": "dest",
                      "type": "string|URL",
                      "desc": "destination path to copy to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`dereference` {boolean} dereference symlinks. **Default:** `false`.",
                          "name": "dereference",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "dereference symlinks."
                        },
                        {
                          "textRaw": "`errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`.",
                          "name": "errorOnExist",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "when `force` is `false`, and the destination exists, throw an error."
                        },
                        {
                          "textRaw": "`filter` {Function} Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. **Default:** `undefined`",
                          "name": "filter",
                          "type": "Function",
                          "default": "`undefined`",
                          "desc": "Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well.",
                          "options": [
                            {
                              "textRaw": "`src` {string} source path to copy.",
                              "name": "src",
                              "type": "string",
                              "desc": "source path to copy."
                            },
                            {
                              "textRaw": "`dest` {string} destination path to copy to.",
                              "name": "dest",
                              "type": "string",
                              "desc": "destination path to copy to."
                            },
                            {
                              "textRaw": "Returns: {boolean} Any non-`Promise` value that is coercible to `boolean`.",
                              "name": "return",
                              "type": "boolean",
                              "desc": "Any non-`Promise` value that is coercible to `boolean`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`force` {boolean} overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior. **Default:** `true`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior."
                        },
                        {
                          "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`. See `mode` flag of `fs.copyFileSync()`.",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0`. See `mode` flag of `fs.copyFileSync()`",
                          "desc": "modifiers for copy operation."
                        },
                        {
                          "textRaw": "`preserveTimestamps` {boolean} When `true` timestamps from `src` will be preserved. **Default:** `false`.",
                          "name": "preserveTimestamps",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` timestamps from `src` will be preserved."
                        },
                        {
                          "textRaw": "`recursive` {boolean} copy directories recursively **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "copy directories recursively"
                        },
                        {
                          "textRaw": "`verbatimSymlinks` {boolean} When `true`, path resolution for symlinks will be skipped. **Default:** `false`",
                          "name": "verbatimSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, path resolution for symlinks will be skipped."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously copies the entire directory structure from <code>src</code> to <code>dest</code>,\nincluding subdirectories and files.</p>\n<p>When copying a directory to another directory, globs are not supported and\nbehavior is similar to <code>cp dir1/ dir2/</code>.</p>"
            },
            {
              "textRaw": "`fs.existsSync(path)`",
              "name": "existsSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the path exists, <code>false</code> otherwise.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsexistspath-callback\"><code>fs.exists()</code></a>.</p>\n<p><code>fs.exists()</code> is deprecated, but <code>fs.existsSync()</code> is not. The <code>callback</code>\nparameter to <code>fs.exists()</code> accepts parameters that are inconsistent with other\nNode.js callbacks. <code>fs.existsSync()</code> does not use a callback.</p>\n<pre><code class=\"language-mjs\">import { existsSync } from 'node:fs';\n\nif (existsSync('/etc/passwd'))\n  console.log('The path exists.');\n</code></pre>"
            },
            {
              "textRaw": "`fs.fchmodSync(fd, mode)`",
              "name": "fchmodSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the permissions on the file. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchmod.2.html\"><code>fchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fchownSync(fd, uid, gid)`",
              "name": "fchownSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`uid` {integer} The file's new owner's user id.",
                      "name": "uid",
                      "type": "integer",
                      "desc": "The file's new owner's user id."
                    },
                    {
                      "textRaw": "`gid` {integer} The file's new group's group id.",
                      "name": "gid",
                      "type": "integer",
                      "desc": "The file's new group's group id."
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the owner of the file. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchown.2.html\"><code>fchown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fdatasyncSync(fd)`",
              "name": "fdatasyncSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Forces all currently queued I/O operations associated with the file to the\noperating system's synchronized I/O completion state. Refer to the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a> documentation for details. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.fstatSync(fd[, options])`",
              "name": "fstatSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.95"
                ],
                "changes": [
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Stats}",
                    "name": "return",
                    "type": "fs.Stats"
                  }
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the file descriptor.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fstat.2.html\"><code>fstat(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fsyncSync(fd)`",
              "name": "fsyncSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Request that all data for the open file descriptor is flushed to the storage\ndevice. The specific implementation is operating system and device specific.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a> documentation for more detail. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.ftruncateSync(fd[, len])`",
              "name": "ftruncateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file descriptor. Returns <code>undefined</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsftruncatefd-len-callback\"><code>fs.ftruncate()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.futimesSync(fd, atime, mtime)`",
              "name": "futimesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"#fsfutimesfd-atime-mtime-callback\"><code>fs.futimes()</code></a>. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.globSync(pattern[, options])`",
              "name": "globSync",
              "type": "method",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62695",
                    "description": "Add support for the `followSymlinks` option."
                  },
                  {
                    "version": [
                      "v24.1.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58182",
                    "description": "Add support for `URL` instances for `cwd` option."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56489",
                    "description": "Add support for `exclude` option to accept glob patterns."
                  },
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52837",
                    "description": "Add support for `withFileTypes` as an option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pattern` {string|string[]}",
                      "name": "pattern",
                      "type": "string|string[]"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} current working directory. **Default:** `process.cwd()`",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "current working directory."
                        },
                        {
                          "textRaw": "`exclude` {Function|string[]} Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it. **Default:** `undefined`.",
                          "name": "exclude",
                          "type": "Function|string[]",
                          "default": "`undefined`",
                          "desc": "Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it."
                        },
                        {
                          "textRaw": "`followSymlinks` {boolean} When `true`, symbolic links to directories are followed while expanding `**` patterns. **Default:** `false`.",
                          "name": "followSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, symbolic links to directories are followed while expanding `**` patterns."
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} `true` if the glob should return paths as Dirents, `false` otherwise. **Default:** `false`.",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if the glob should return paths as Dirents, `false` otherwise."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string[]} paths of files that match the pattern.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "paths of files that match the pattern."
                  }
                }
              ],
              "desc": "<p>When <code>followSymlinks</code> is enabled, detected symbolic link cycles are not\ntraversed recursively.</p>\n<pre><code class=\"language-mjs\">import { globSync } from 'node:fs';\n\nconsole.log(globSync('**/*.js'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { globSync } = require('node:fs');\n\nconsole.log(globSync('**/*.js'));\n</code></pre>"
            },
            {
              "textRaw": "`fs.lchmodSync(path, mode)`",
              "name": "lchmodSync",
              "type": "method",
              "meta": {
                "changes": [],
                "deprecated": [
                  "v0.4.7"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer}",
                      "name": "mode",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the permissions on a symbolic link. Returns <code>undefined</code>.</p>\n<p>This method is only implemented on macOS.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchmod.2.html\"><code>lchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.lchownSync(path, uid, gid)`",
              "name": "lchownSync",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "This API is no longer deprecated."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer} The file's new owner's user id.",
                      "name": "uid",
                      "type": "integer",
                      "desc": "The file's new owner's user id."
                    },
                    {
                      "textRaw": "`gid` {integer} The file's new group's group id.",
                      "name": "gid",
                      "type": "integer",
                      "desc": "The file's new group's group id."
                    }
                  ]
                }
              ],
              "desc": "<p>Set the owner for the path. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchown.2.html\"><code>lchown(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.lutimesSync(path, atime, mtime)`",
              "name": "lutimesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ]
                }
              ],
              "desc": "<p>Change the file system timestamps of the symbolic link referenced by <code>path</code>.\nReturns <code>undefined</code>, or throws an exception when parameters are incorrect or\nthe operation fails. This is the synchronous version of <a href=\"#fslutimespath-atime-mtime-callback\"><code>fs.lutimes()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.linkSync(existingPath, newPath)`",
              "name": "linkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `existingPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`existingPath` {string|Buffer|URL}",
                      "name": "existingPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new link from the <code>existingPath</code> to the <code>newPath</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a> documentation for more detail. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.lstatSync(path[, options])`",
              "name": "lstatSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.3.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33716",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Stats}",
                    "name": "return",
                    "type": "fs.Stats"
                  }
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the symbolic link referred to by <code>path</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdirSync(path[, options])`",
              "name": "mkdirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31530",
                    "description": "In `recursive` mode, the first created path is returned now."
                  },
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21875",
                    "description": "The second argument can now be an `options` object with `recursive` and `mode` properties."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object|integer}",
                      "name": "options",
                      "type": "Object|integer",
                      "options": [
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`mode` {string|integer} Not supported on Windows. **Default:** `0o777`.",
                          "name": "mode",
                          "type": "string|integer",
                          "default": "`0o777`",
                          "desc": "Not supported on Windows."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined}",
                    "name": "return",
                    "type": "string|undefined"
                  }
                }
              ],
              "desc": "<p>Synchronously creates a directory. Returns <code>undefined</code>, or if <code>recursive</code> is\n<code>true</code>, the first directory path created.\nThis is the synchronous version of <a href=\"#fsmkdirpath-options-callback\"><code>fs.mkdir()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/mkdir.2.html\"><code>mkdir(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdtempSync(prefix[, options])`",
              "name": "mkdtempSync",
              "type": "method",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48828",
                    "description": "The `prefix` parameter now accepts buffers and URL."
                  },
                  {
                    "version": [
                      "v16.5.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39028",
                    "description": "The `prefix` parameter now accepts an empty string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns the created directory path.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsmkdtempprefix-options-callback\"><code>fs.mkdtemp()</code></a>.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>"
            },
            {
              "textRaw": "`fs.mkdtempDisposableSync(prefix[, options])`",
              "name": "mkdtempDisposableSync",
              "type": "method",
              "meta": {
                "added": [
                  "v24.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A disposable object:",
                    "name": "return",
                    "type": "Object",
                    "desc": "A disposable object:",
                    "options": [
                      {
                        "textRaw": "`path` {string} The path of the created directory.",
                        "name": "path",
                        "type": "string",
                        "desc": "The path of the created directory."
                      },
                      {
                        "textRaw": "`remove` {Function} A function which removes the created directory.",
                        "name": "remove",
                        "type": "Function",
                        "desc": "A function which removes the created directory."
                      },
                      {
                        "textRaw": "`[Symbol.dispose]` {Function} The same as `remove`.",
                        "name": "[Symbol.dispose]",
                        "type": "Function",
                        "desc": "The same as `remove`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns a disposable object whose <code>path</code> property holds the created directory\npath. When the object is disposed, the directory and its contents will be\nremoved if it still exists. If the directory cannot be deleted, disposal will\nthrow an error. The object has a <code>remove()</code> method which will perform the same\ntask.</p>\n<p>For detailed information, see the documentation of <a href=\"#fsmkdtempprefix-options-callback\"><code>fs.mkdtemp()</code></a>.</p>\n<p>There is no callback-based version of this API because it is designed for use\nwith the <code>using</code> syntax.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>"
            },
            {
              "textRaw": "`fs.opendirSync(path[, options])`",
              "name": "opendirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": [
                      "v13.1.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`bufferSize` {number} Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. **Default:** `32`",
                          "name": "bufferSize",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage."
                        },
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Dir}",
                    "name": "return",
                    "type": "fs.Dir"
                  }
                }
              ],
              "desc": "<p>Synchronously open a directory. See <a href=\"http://man7.org/linux/man-pages/man3/opendir.3.html\"><code>opendir(3)</code></a>.</p>\n<p>Creates an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>, which contains all further functions for reading from\nand cleaning up the directory.</p>\n<p>The <code>encoding</code> option sets the encoding for the <code>path</code> while opening the\ndirectory and subsequent read operations.</p>"
            },
            {
              "textRaw": "`fs.openSync(path[, flags[, mode]])`",
              "name": "openSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v11.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23767",
                    "description": "The `flags` argument is now optional and defaults to `'r'`."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18801",
                    "description": "The `as` and `as+` flags are supported now."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`flags` {string|number} **Default:** `'r'`. See support of file system `flags`.",
                      "name": "flags",
                      "type": "string|number",
                      "default": "`'r'`. See support of file system `flags`",
                      "optional": true
                    },
                    {
                      "textRaw": "`mode` {string|integer} **Default:** `0o666`",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns an integer representing the file descriptor.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.readdirSync(path[, options])`",
              "name": "readdirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} **Default:** `false`",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string[]|Buffer[]|fs.Dirent[]}",
                    "name": "return",
                    "type": "string[]|Buffer[]|fs.Dirent[]"
                  }
                }
              ],
              "desc": "<p>Reads the contents of the directory.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe filenames returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe filenames returned will be passed as <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the result will contain\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects.</p>"
            },
            {
              "textRaw": "`fs.readFileSync(path[, options])`",
              "name": "readFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.8"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `path` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `null`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Returns the contents of the <code>path</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadfilepath-options-callback\"><code>fs.readFile()</code></a>.</p>\n<p>If the <code>encoding</code> option is specified then this function returns a\nstring. Otherwise it returns a buffer.</p>\n<p>Similar to <a href=\"#fsreadfilepath-options-callback\"><code>fs.readFile()</code></a>, when the path is a directory, the behavior of\n<code>fs.readFileSync()</code> is platform-specific.</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\n// macOS, Linux, and Windows\nreadFileSync('&#x3C;directory>');\n// => [Error: EISDIR: illegal operation on a directory, read &#x3C;directory>]\n\n//  FreeBSD\nreadFileSync('&#x3C;directory>'); // => &#x3C;data>\n</code></pre>"
            },
            {
              "textRaw": "`fs.readlinkSync(path[, options])`",
              "name": "readlinkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Returns the symbolic link's string value.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe link path returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe link path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>"
            },
            {
              "textRaw": "`fs.readSync(fd, buffer, offset, length[, position])`",
              "name": "readSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4518",
                    "description": "The `length` parameter can now be `0`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`offset` {integer}",
                      "name": "offset",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`length` {integer}",
                      "name": "length",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`position` {integer|bigint|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|bigint|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns the number of <code>bytesRead</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.readSync(fd, buffer[, options])`",
              "name": "readSync",
              "type": "method",
              "meta": {
                "added": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32460",
                    "description": "Options object can be passed in to make offset, length, and position optional."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|bigint|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns the number of <code>bytesRead</code>.</p>\n<p>Similar to the above <code>fs.readSync</code> function, this version takes an optional <code>options</code> object.\nIf no <code>options</code> object is specified, it will default with the above values.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.readvSync(fd, buffers[, position])`",
              "name": "readvSync",
              "type": "method",
              "meta": {
                "added": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes read.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes read."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadvfd-buffers-position-callback\"><code>fs.readv()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.realpathSync(path[, options])`",
              "name": "realpathSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13028",
                    "description": "Pipe/Socket resolve support was added."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v6.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7899",
                    "description": "Calling `realpathSync` now works again for various edge cases on Windows."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3594",
                    "description": "The `cache` parameter was removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Returns the resolved pathname.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsrealpathpath-options-callback\"><code>fs.realpath()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.realpathSync.native(path[, options])`",
              "name": "native",
              "type": "method",
              "meta": {
                "added": [
                  "v9.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a>.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>On Linux, when Node.js is linked against musl libc, the procfs file system must\nbe mounted on <code>/proc</code> in order for this function to work. Glibc does not have\nthis restriction.</p>"
            },
            {
              "textRaw": "`fs.renameSync(oldPath, newPath)`",
              "name": "renameSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `oldPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`oldPath` {string|Buffer|URL}",
                      "name": "oldPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Renames the file from <code>oldPath</code> to <code>newPath</code>. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.rmdirSync(path[, options])`",
              "name": "rmdirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "Remove `recursive` option."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdirSync(path, { recursive: true })` on a `path` that is a file is no longer permitted and results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdirSync(path, { recursive: true })` on a `path` that does not exist is no longer permitted and results in a `ENOENT` error."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "The `recursive` option is deprecated, using it triggers a deprecation warning."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "The `recursive` option is deprecated, use `fs.rmSync` instead."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30644",
                    "description": "The `maxBusyTries` option is renamed to `maxRetries`, and its default is 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29168",
                    "description": "The `recursive`, `maxBusyTries`, and `emfileWait` options are now supported."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameters can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object} There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "name": "options",
                      "type": "Object",
                      "desc": "There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/rmdir.2.html\"><code>rmdir(2)</code></a>. Returns <code>undefined</code>.</p>\n<p>Using <code>fs.rmdirSync()</code> on a file (not a directory) results in an <code>ENOENT</code> error\non Windows and an <code>ENOTDIR</code> error on POSIX.</p>\n<p>To get a behavior similar to the <code>rm -rf</code> Unix command, use <a href=\"#fsrmsyncpath-options\"><code>fs.rmSync()</code></a>\nwith options <code>{ recursive: true, force: true }</code>.</p>"
            },
            {
              "textRaw": "`fs.rmSync(path[, options])`",
              "name": "rmSync",
              "type": "method",
              "meta": {
                "added": [
                  "v14.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41132",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`force` {boolean} When `true`, exceptions will be ignored if `path` does not exist. **Default:** `false`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, exceptions will be ignored if `path` does not exist."
                        },
                        {
                          "textRaw": "`maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`. **Default:** `0`.",
                          "name": "maxRetries",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`."
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure."
                        },
                        {
                          "textRaw": "`retryDelay` {integer} The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`.",
                          "name": "retryDelay",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously removes files and directories (modeled on the standard POSIX <code>rm</code>\nutility). Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.statSync(path[, options])`",
              "name": "statSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.3.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33716",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Stats}",
                    "name": "return",
                    "type": "fs.Stats"
                  }
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the path.</p>"
            },
            {
              "textRaw": "`fs.statfsSync(path[, options])`",
              "name": "statfsSync",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.StatFs} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.StatFs} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.StatFs}",
                    "name": "return",
                    "type": "fs.StatFs"
                  }
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/statfs.2.html\"><code>statfs(2)</code></a>. Returns information about the mounted file system which\ncontains <code>path</code>.</p>\n<p>In case of an error, the <code>err.code</code> will be one of <a href=\"errors.html#common-system-errors\">Common System Errors</a>.</p>"
            },
            {
              "textRaw": "`fs.symlinkSync(target, path[, type])`",
              "name": "symlinkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23724",
                    "description": "If the `type` argument is left undefined, Node will autodetect `target` type and automatically select `dir` or `file`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `target` and `path` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {string|Buffer|URL}",
                      "name": "target",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`type` {string|null} **Default:** `null`",
                      "name": "type",
                      "type": "string|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `undefined`.",
                    "name": "return",
                    "desc": "`undefined`."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fssymlinktarget-path-type-callback\"><code>fs.symlink()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.truncateSync(path[, len])`",
              "name": "truncateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file. Returns <code>undefined</code>. A file descriptor can also be\npassed as the first argument. In this case, <code>fs.ftruncateSync()</code> is called.</p>\n<p>Passing a file descriptor is deprecated and may result in an error being thrown\nin the future.</p>"
            },
            {
              "textRaw": "`fs.unlinkSync(path)`",
              "name": "unlinkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.utimesSync(path, atime, mtime)`",
              "name": "utimesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11919",
                    "description": "`NaN`, `Infinity`, and `-Infinity` are no longer valid time specifiers."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `undefined`.",
                    "name": "return",
                    "desc": "`undefined`."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsutimespath-atime-mtime-callback\"><code>fs.utimes()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeFileSync(file, data[, options])`",
              "name": "writeFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50009",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "Passing to the `data` parameter an object with an own `toString` function is no longer supported."
                  },
                  {
                    "version": "v17.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Passing to the `data` parameter an object with an own `toString` function is deprecated."
                  },
                  {
                    "version": "v14.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34993",
                    "description": "The `data` parameter will stringify an object with an explicit `toString` function."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `data` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `data` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "file",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If all data is successfully written to the file, and `flush` is `true`, `fs.fsyncSync()` is used to flush the data.",
                          "name": "flush",
                          "type": "boolean",
                          "desc": "If all data is successfully written to the file, and `flush` is `true`, `fs.fsyncSync()` is used to flush the data."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `undefined`.",
                    "name": "return",
                    "desc": "`undefined`."
                  }
                }
              ],
              "desc": "<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefilefile-data-options-callback\"><code>fs.writeFile()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeSync(fd, buffer, offset[, length[, position]])`",
              "name": "writeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `buffer` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `buffer` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `offset` and `length` parameters are optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`offset` {integer} **Default:** `0`",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`"
                    },
                    {
                      "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                      "name": "length",
                      "type": "integer",
                      "default": "`buffer.byteLength - offset`",
                      "optional": true
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefd-buffer-offset-length-position-callback\"><code>fs.write(fd, buffer...)</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeSync(fd, buffer[, options])`",
              "name": "writeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefd-buffer-offset-length-position-callback\"><code>fs.write(fd, buffer...)</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeSync(fd, string[, position[, encoding]])`",
              "name": "writeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `string` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `position` parameter is optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`string` {string}",
                      "name": "string",
                      "type": "string"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefd-string-position-encoding-callback\"><code>fs.write(fd, string...)</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writevSync(fd, buffers[, position])`",
              "name": "writevSync",
              "type": "method",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritevfd-buffers-position-callback\"><code>fs.writev()</code></a>.</p>"
            }
          ],
          "displayName": "Synchronous API"
        },
        {
          "textRaw": "Common Objects",
          "name": "common_objects",
          "type": "module",
          "desc": "<p>The common objects are shared by all of the file system API variants\n(promise, callback, and synchronous).</p>",
          "classes": [
            {
              "textRaw": "Class: `fs.Dir`",
              "name": "fs.Dir",
              "type": "class",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "desc": "<p>A class representing a directory stream.</p>\n<p>Created by <a href=\"#fsopendirpath-options-callback\"><code>fs.opendir()</code></a>, <a href=\"#fsopendirsyncpath-options\"><code>fs.opendirSync()</code></a>, or\n<a href=\"#fspromisesopendirpath-options\"><code>fsPromises.opendir()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { opendir } from 'node:fs/promises';\n\ntry {\n  const dir = await opendir('./');\n  for await (const dirent of dir)\n    console.log(dirent.name);\n} catch (err) {\n  console.error(err);\n}\n</code></pre>\n<p>When using the async iterator, the <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a> object will be automatically\nclosed after the iterator exits.</p>",
              "methods": [
                {
                  "textRaw": "`dir.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>\n<p>A promise is returned that will be fulfilled after the resource has been\nclosed.</p>"
                },
                {
                  "textRaw": "`dir.close(callback)`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Asynchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>\n<p>The <code>callback</code> will be called after the resource handle has been closed.</p>"
                },
                {
                  "textRaw": "`dir.closeSync()`",
                  "name": "closeSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Synchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>"
                },
                {
                  "textRaw": "`dir.read()`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with a {fs.Dirent|null}",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with a {fs.Dirent|null}"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously read the next directory entry via <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> as an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>.</p>\n<p>A promise is returned that will be fulfilled with an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>, or <code>null</code>\nif there are no more directory entries to read.</p>\n<p>Directory entries returned by this function are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir.read(callback)`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            },
                            {
                              "textRaw": "`dirent` {fs.Dirent|null}",
                              "name": "dirent",
                              "type": "fs.Dirent|null"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Asynchronously read the next directory entry via <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> as an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>.</p>\n<p>After the read is completed, the <code>callback</code> will be called with an\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>, or <code>null</code> if there are no more directory entries to read.</p>\n<p>Directory entries returned by this function are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir.readSync()`",
                  "name": "readSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.Dirent|null}",
                        "name": "return",
                        "type": "fs.Dirent|null"
                      }
                    }
                  ],
                  "desc": "<p>Synchronously read the next directory entry as an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>. See the\nPOSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more detail.</p>\n<p>If there are no more directory entries to read, <code>null</code> will be returned.</p>\n<p>Directory entries returned by this function are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir[Symbol.asyncIterator]()`",
                  "name": "[Symbol.asyncIterator]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {AsyncIterator} An AsyncIterator of {fs.Dirent}",
                        "name": "return",
                        "type": "AsyncIterator",
                        "desc": "An AsyncIterator of {fs.Dirent}"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously iterates over the directory until all entries have\nbeen read. Refer to the POSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more detail.</p>\n<p>Entries returned by the async iterator are always an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>.\nThe <code>null</code> case from <code>dir.read()</code> is handled internally.</p>\n<p>See <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a> for an example.</p>\n<p>Directory entries returned by this iterator are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir[Symbol.asyncDispose]()`",
                  "name": "[Symbol.asyncDispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v24.1.0",
                      "v22.1.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>dir.close()</code> if the directory handle is open, and returns a promise that\nfulfills when disposal is complete.</p>"
                },
                {
                  "textRaw": "`dir[Symbol.dispose]()`",
                  "name": "[Symbol.dispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v24.1.0",
                      "v22.1.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>dir.closeSync()</code> if the directory handle is open, and returns\n<code>undefined</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "path",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The read-only path of this directory as was provided to <a href=\"#fsopendirpath-options-callback\"><code>fs.opendir()</code></a>,\n<a href=\"#fsopendirsyncpath-options\"><code>fs.opendirSync()</code></a>, or <a href=\"#fspromisesopendirpath-options\"><code>fsPromises.opendir()</code></a>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.Dirent`",
              "name": "fs.Dirent",
              "type": "class",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "desc": "<p>A representation of a directory entry, which can be a file or a subdirectory\nwithin the directory, as returned by reading from an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>. The\ndirectory entry is a combination of the file name and file type pairs.</p>\n<p>Additionally, when <a href=\"#fsreaddirpath-options-callback\"><code>fs.readdir()</code></a> or <a href=\"#fsreaddirsyncpath-options\"><code>fs.readdirSync()</code></a> is called with\nthe <code>withFileTypes</code> option set to <code>true</code>, the resulting array is filled with\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects, rather than strings or <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>s.</p>",
              "methods": [
                {
                  "textRaw": "`dirent.isBlockDevice()`",
                  "name": "isBlockDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a block device.</p>"
                },
                {
                  "textRaw": "`dirent.isCharacterDevice()`",
                  "name": "isCharacterDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a character device.</p>"
                },
                {
                  "textRaw": "`dirent.isDirectory()`",
                  "name": "isDirectory",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a file system\ndirectory.</p>"
                },
                {
                  "textRaw": "`dirent.isFIFO()`",
                  "name": "isFIFO",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a first-in-first-out\n(FIFO) pipe.</p>"
                },
                {
                  "textRaw": "`dirent.isFile()`",
                  "name": "isFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a regular file.</p>"
                },
                {
                  "textRaw": "`dirent.isSocket()`",
                  "name": "isSocket",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a socket.</p>"
                },
                {
                  "textRaw": "`dirent.isSymbolicLink()`",
                  "name": "isSymbolicLink",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a symbolic link.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string|Buffer}",
                  "name": "name",
                  "type": "string|Buffer",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The file name that this <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object refers to. The type of this\nvalue is determined by the <code>options.encoding</code> passed to <a href=\"#fsreaddirpath-options-callback\"><code>fs.readdir()</code></a> or\n<a href=\"#fsreaddirsyncpath-options\"><code>fs.readdirSync()</code></a>.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "parentPath",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v21.4.0",
                      "v20.12.0",
                      "v18.20.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57513",
                        "description": "Marking the API stable."
                      }
                    ]
                  },
                  "desc": "<p>The path to the parent directory of the file this <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object refers to.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.FSWatcher`",
              "name": "fs.FSWatcher",
              "type": "class",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>A successful call to <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a> method will return a new <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>\nobject.</p>\n<p>All <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> objects emit a <code>'change'</code> event whenever a specific watched\nfile is modified.</p>",
              "events": [
                {
                  "textRaw": "Event: `'change'`",
                  "name": "change",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.5.8"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`eventType` {string} The type of change event that has occurred",
                      "name": "eventType",
                      "type": "string",
                      "desc": "The type of change event that has occurred"
                    },
                    {
                      "textRaw": "`filename` {string|Buffer} The filename that changed (if relevant/available)",
                      "name": "filename",
                      "type": "string|Buffer",
                      "desc": "The filename that changed (if relevant/available)"
                    }
                  ],
                  "desc": "<p>Emitted when something changes in a watched directory or file.\nSee more details in <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a>.</p>\n<p>The <code>filename</code> argument may not be provided depending on operating system\nsupport. If <code>filename</code> is provided, it will be provided as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> if <code>fs.watch()</code> is called with its <code>encoding</code> option set to <code>'buffer'</code>, otherwise\n<code>filename</code> will be a UTF-8 string.</p>\n<pre><code class=\"language-mjs\">import { watch } from 'node:fs';\n// Example when handled through fs.watch() listener\nwatch('./tmp', { encoding: 'buffer' }, (eventType, filename) => {\n  if (filename) {\n    console.log(filename);\n    // Prints: &#x3C;Buffer ...>\n  }\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the watcher stops watching for changes. The closed\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object is no longer usable in the event handler.</p>"
                },
                {
                  "textRaw": "Event: `'error'`",
                  "name": "error",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.5.8"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ],
                  "desc": "<p>Emitted when an error occurs while watching the file. The errored\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object is no longer usable in the event handler.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`watcher.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.5.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Stop watching for changes on the given <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>. Once stopped, the\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object is no longer usable.</p>"
                },
                {
                  "textRaw": "`watcher.ref()`",
                  "name": "ref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.FSWatcher}",
                        "name": "return",
                        "type": "fs.FSWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> is active. Calling <code>watcher.ref()</code> multiple times will have\nno effect.</p>\n<p>By default, all <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> objects are \"ref'ed\", making it normally\nunnecessary to call <code>watcher.ref()</code> unless <code>watcher.unref()</code> had been\ncalled previously.</p>"
                },
                {
                  "textRaw": "`watcher.unref()`",
                  "name": "unref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.FSWatcher}",
                        "name": "return",
                        "type": "fs.FSWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, the active <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object will not require the Node.js\nevent loop to remain active. If there is no other activity keeping the\nevent loop running, the process may exit before the <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object's\ncallback is invoked. Calling <code>watcher.unref()</code> multiple times will have\nno effect.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.StatWatcher`",
              "name": "fs.StatWatcher",
              "type": "class",
              "meta": {
                "added": [
                  "v14.3.0",
                  "v12.20.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>A successful call to <code>fs.watchFile()</code> method will return a new <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a>\nobject.</p>",
              "methods": [
                {
                  "textRaw": "`watcher.ref()`",
                  "name": "ref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.StatWatcher}",
                        "name": "return",
                        "type": "fs.StatWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> is active. Calling <code>watcher.ref()</code> multiple times will have\nno effect.</p>\n<p>By default, all <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> objects are \"ref'ed\", making it normally\nunnecessary to call <code>watcher.ref()</code> unless <code>watcher.unref()</code> had been\ncalled previously.</p>"
                },
                {
                  "textRaw": "`watcher.unref()`",
                  "name": "unref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.StatWatcher}",
                        "name": "return",
                        "type": "fs.StatWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, the active <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> object will not require the Node.js\nevent loop to remain active. If there is no other activity keeping the\nevent loop running, the process may exit before the <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> object's\ncallback is invoked. Calling <code>watcher.unref()</code> multiple times will have\nno effect.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.ReadStream`",
              "name": "fs.ReadStream",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>Instances of <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a> cannot be constructed directly. They are created and\nreturned using the <a href=\"#fscreatereadstreampath-options\"><code>fs.createReadStream()</code></a> function.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a>'s underlying file descriptor has been closed.</p>"
                },
                {
                  "textRaw": "Event: `'open'`",
                  "name": "open",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`fd` {integer} Integer file descriptor used by the {fs.ReadStream}.",
                      "name": "fd",
                      "type": "integer",
                      "desc": "Integer file descriptor used by the {fs.ReadStream}."
                    }
                  ],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a>'s file descriptor has been opened.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v9.11.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a> is ready to be used.</p>\n<p>Fires immediately after <code>'open'</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "bytesRead",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v6.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of bytes that have been read so far.</p>"
                },
                {
                  "textRaw": "Type: {string|Buffer}",
                  "name": "path",
                  "type": "string|Buffer",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The path to the file the stream is reading from as specified in the first\nargument to <code>fs.createReadStream()</code>. If <code>path</code> is passed as a string, then\n<code>readStream.path</code> will be a string. If <code>path</code> is passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, then <code>readStream.path</code> will be a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>. If <code>fd</code> is specified, then\n<code>readStream.path</code> will be <code>undefined</code>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pending",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v11.2.0",
                      "v10.16.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This property is <code>true</code> if the underlying file has not been opened yet,\ni.e. before the <code>'ready'</code> event is emitted.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.Stats`",
              "name": "fs.Stats",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v26.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60789",
                    "description": "Added `Temporal.Instant` support."
                  },
                  {
                    "version": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51879",
                    "description": "Public constructor is deprecated."
                  },
                  {
                    "version": "v8.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13173",
                    "description": "Added times as numbers."
                  }
                ]
              },
              "desc": "<p>A <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object provides information about a file.</p>\n<p>Objects returned from <a href=\"#fsstatpath-options-callback\"><code>fs.stat()</code></a>, <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a>, <a href=\"#fsfstatfd-options-callback\"><code>fs.fstat()</code></a>, and\ntheir synchronous counterparts are of this type.\nIf <code>bigint</code> in the <code>options</code> passed to those methods is true, the numeric values\nwill be <code>bigint</code> instead of <code>number</code>, and the object will contain additional\nnanosecond-precision properties suffixed with <code>Ns</code>.\n<code>Stat</code> objects are not to be created directly using the <code>new</code> keyword.</p>\n<pre><code class=\"language-console\">Stats {\n  dev: 2114,\n  ino: 48064969,\n  mode: 33188,\n  nlink: 1,\n  uid: 85,\n  gid: 100,\n  rdev: 0,\n  size: 527,\n  blksize: 4096,\n  blocks: 8,\n  atimeMs: 1318289051000.1,\n  mtimeMs: 1318289051000.1,\n  ctimeMs: 1318289051000.1,\n  birthtimeMs: 1318289051000.1,\n\n  // Instances of Date\n  atime: Mon, 10 Oct 2011 23:24:11 GMT,\n  mtime: Mon, 10 Oct 2011 23:24:11 GMT,\n  ctime: Mon, 10 Oct 2011 23:24:11 GMT,\n  birthtime: Mon, 10 Oct 2011 23:24:11 GMT,\n\n  // Instances of Temporal.Instant\n  atimeInstant: 2011-10-10T23:24:11.0001Z,\n  mtimeInstant: 2011-10-10T23:24:11.0001Z,\n  ctimeInstant: 2011-10-10T23:24:11.0001Z,\n  birthtimeInstant: 2011-10-10T23:24:11.0001Z\n}\n</code></pre>\n<p><code>bigint</code> version:</p>\n<pre><code class=\"language-console\">BigIntStats {\n  dev: 2114n,\n  ino: 48064969n,\n  mode: 33188n,\n  nlink: 1n,\n  uid: 85n,\n  gid: 100n,\n  rdev: 0n,\n  size: 527n,\n  blksize: 4096n,\n  blocks: 8n,\n  atimeMs: 1318289051000n,\n  mtimeMs: 1318289051000n,\n  ctimeMs: 1318289051000n,\n  birthtimeMs: 1318289051000n,\n  atimeNs: 1318289051000000000n,\n  mtimeNs: 1318289051000000000n,\n  ctimeNs: 1318289051000000000n,\n  birthtimeNs: 1318289051000000000n,\n\n  // Instances of Date\n  atime: Mon, 10 Oct 2011 23:24:11 GMT,\n  mtime: Mon, 10 Oct 2011 23:24:11 GMT,\n  ctime: Mon, 10 Oct 2011 23:24:11 GMT,\n  birthtime: Mon, 10 Oct 2011 23:24:11 GMT,\n\n  // Instances of Temporal.Instant\n  atimeInstant: 2011-10-10T23:24:11Z,\n  mtimeInstant: 2011-10-10T23:24:11Z,\n  ctimeInstant: 2011-10-10T23:24:11Z,\n  birthtimeInstant: 2011-10-10T23:24:11Z\n}\n</code></pre>",
              "methods": [
                {
                  "textRaw": "`stats.isBlockDevice()`",
                  "name": "isBlockDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a block device.</p>"
                },
                {
                  "textRaw": "`stats.isCharacterDevice()`",
                  "name": "isCharacterDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a character device.</p>"
                },
                {
                  "textRaw": "`stats.isDirectory()`",
                  "name": "isDirectory",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a file system directory.</p>\n<p>If the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object was obtained from calling <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a> on a\nsymbolic link which resolves to a directory, this method will return <code>false</code>.\nThis is because <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a> returns information\nabout a symbolic link itself and not the path it resolves to.</p>"
                },
                {
                  "textRaw": "`stats.isFIFO()`",
                  "name": "isFIFO",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a first-in-first-out (FIFO)\npipe.</p>"
                },
                {
                  "textRaw": "`stats.isFile()`",
                  "name": "isFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a regular file.</p>"
                },
                {
                  "textRaw": "`stats.isSocket()`",
                  "name": "isSocket",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a socket.</p>"
                },
                {
                  "textRaw": "`stats.isSymbolicLink()`",
                  "name": "isSymbolicLink",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a symbolic link.</p>\n<p>This method is only valid when using <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "dev",
                  "type": "number|bigint",
                  "desc": "<p>The numeric identifier of the device containing the file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "ino",
                  "type": "number|bigint",
                  "desc": "<p>The file system specific \"Inode\" number for the file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "mode",
                  "type": "number|bigint",
                  "desc": "<p>A bit-field describing the file type and mode.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "nlink",
                  "type": "number|bigint",
                  "desc": "<p>The number of hard-links that exist for the file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "uid",
                  "type": "number|bigint",
                  "desc": "<p>The numeric user identifier of the user that owns the file (POSIX).</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "gid",
                  "type": "number|bigint",
                  "desc": "<p>The numeric group identifier of the group that owns the file (POSIX).</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "rdev",
                  "type": "number|bigint",
                  "desc": "<p>A numeric device identifier if the file represents a device.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "size",
                  "type": "number|bigint",
                  "desc": "<p>The size of the file in bytes.</p>\n<p>If the underlying file system does not support getting the size of the file,\nthis will be <code>0</code>.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "blksize",
                  "type": "number|bigint",
                  "desc": "<p>The file system block size for i/o operations.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "blocks",
                  "type": "number|bigint",
                  "desc": "<p>The number of blocks allocated for this file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "atimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was accessed expressed in\nmilliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "mtimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was modified expressed in\nmilliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "ctimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time the file status was changed expressed\nin milliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "birthtimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the creation time of this file expressed in\nmilliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "atimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the last time this file was accessed expressed in\nnanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "mtimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the last time this file was modified expressed in\nnanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "ctimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the last time the file status was changed expressed\nin nanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "birthtimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the creation time of this file expressed in\nnanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "atime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was accessed.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "mtime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was modified.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "ctime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time the file status was changed.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "birthtime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the creation time of this file.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Stat time values",
                  "name": "stat_time_values",
                  "type": "module",
                  "desc": "<p>The <code>atimeMs</code>, <code>mtimeMs</code>, <code>ctimeMs</code>, <code>birthtimeMs</code> properties are\nnumeric values that hold the corresponding times in milliseconds. Their\nprecision is platform specific. When <code>bigint: true</code> is passed into the\nmethod that generates the object, the properties will be <a href=\"https://tc39.github.io/proposal-bigint\">bigints</a>,\notherwise they will be <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures#number_type\">numbers</a>.</p>\n<p>The <code>atimeNs</code>, <code>mtimeNs</code>, <code>ctimeNs</code>, <code>birthtimeNs</code> properties are\n<a href=\"https://tc39.github.io/proposal-bigint\">bigints</a> that hold the corresponding times in nanoseconds. They are\nonly present when <code>bigint: true</code> is passed into the method that generates\nthe object. Their precision is platform specific.</p>\n<p><code>atime</code>, <code>mtime</code>, <code>ctime</code>, and <code>birthtime</code> are\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\"><code>Date</code></a> object alternate representations of the various times. The\n<code>Date</code> and number values are not connected. Assigning a new number value, or\nmutating the <code>Date</code> value, will not be reflected in the corresponding alternate\nrepresentation.</p>\n<p>The times in the stat object have the following semantics:</p>\n<ul>\n<li><code>atime</code> \"Access Time\": Time when file data last accessed. Changed\nby the <a href=\"http://man7.org/linux/man-pages/man2/mknod.2.html\"><code>mknod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a>, and <a href=\"http://man7.org/linux/man-pages/man2/read.2.html\"><code>read(2)</code></a> system calls.</li>\n<li><code>mtime</code> \"Modified Time\": Time when file data last modified.\nChanged by the <a href=\"http://man7.org/linux/man-pages/man2/mknod.2.html\"><code>mknod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a>, and <a href=\"http://man7.org/linux/man-pages/man2/write.2.html\"><code>write(2)</code></a> system calls.</li>\n<li><code>ctime</code> \"Change Time\": Time when file status was last changed\n(inode data modification). Changed by the <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a>,\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/mknod.2.html\"><code>mknod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a>,\n<a href=\"http://man7.org/linux/man-pages/man2/read.2.html\"><code>read(2)</code></a>, and <a href=\"http://man7.org/linux/man-pages/man2/write.2.html\"><code>write(2)</code></a> system calls.</li>\n<li><code>birthtime</code> \"Birth Time\": Time of file creation. Set once when the\nfile is created. On file systems where birthtime is not available,\nthis field may instead hold either the <code>ctime</code> or\n<code>1970-01-01T00:00Z</code> (ie, Unix epoch timestamp <code>0</code>). This value may be greater\nthan <code>atime</code> or <code>mtime</code> in this case. On Darwin and other FreeBSD variants,\nalso set if the <code>atime</code> is explicitly set to an earlier value than the current\n<code>birthtime</code> using the <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a> system call.</li>\n</ul>\n<p>Prior to Node.js 0.12, the <code>ctime</code> held the <code>birthtime</code> on Windows systems. As\nof 0.12, <code>ctime</code> is not \"creation time\", and on Unix systems, it never was.</p>",
                  "displayName": "Stat time values"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.StatFs`",
              "name": "fs.StatFs",
              "type": "class",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "desc": "<p>Provides information about a mounted file system.</p>\n<p>Objects returned from <a href=\"#fsstatfspath-options-callback\"><code>fs.statfs()</code></a> and its synchronous counterpart are of\nthis type. If <code>bigint</code> in the <code>options</code> passed to those methods is <code>true</code>, the\nnumeric values will be <code>bigint</code> instead of <code>number</code>.</p>\n<pre><code class=\"language-console\">StatFs {\n  type: 1397114950,\n  bsize: 4096,\n  frsize: 4096,\n  blocks: 121938943,\n  bfree: 61058895,\n  bavail: 61058895,\n  files: 999,\n  ffree: 1000000\n}\n</code></pre>\n<p><code>bigint</code> version:</p>\n<pre><code class=\"language-console\">StatFs {\n  type: 1397114950n,\n  bsize: 4096n,\n  frsize: 4096n,\n  blocks: 121938943n,\n  bfree: 61058895n,\n  bavail: 61058895n,\n  files: 999n,\n  ffree: 1000000n\n}\n</code></pre>",
              "properties": [
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "bavail",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Free blocks available to unprivileged users.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "bfree",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Free blocks in file system.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "blocks",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Total data blocks in file system.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "bsize",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Optimal transfer block size.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "frsize",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Fundamental file system block size.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "ffree",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Free file nodes in file system.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "files",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Total file nodes in file system.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "type",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Type of file system.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.Utf8Stream`",
              "name": "fs.Utf8Stream",
              "type": "class",
              "meta": {
                "added": [
                  "v24.6.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>An optimized UTF-8 stream writer that allows for flushing all the internal\nbuffering on demand. It handles <code>EAGAIN</code> errors correctly, allowing for\ncustomization, for example, by dropping content if the disk is busy.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'close'</code> event is emitted when the stream is fully closed.</p>"
                },
                {
                  "textRaw": "Event: `'drain'`",
                  "name": "drain",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'drain'</code> event is emitted when the internal buffer has drained sufficiently\nto allow continued writing.</p>"
                },
                {
                  "textRaw": "Event: `'drop'`",
                  "name": "drop",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'drop'</code> event is emitted when the maximal length is reached and that data\nwill not be written. The data that was dropped is passed as the first argument\nto the event handler.</p>"
                },
                {
                  "textRaw": "Event: `'error'`",
                  "name": "error",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'error'</code> event is emitted when an error occurs.</p>"
                },
                {
                  "textRaw": "Event: `'finish'`",
                  "name": "finish",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'finish'</code> event is emitted when the stream has been ended and all data has\nbeen flushed to the underlying file.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'ready'</code> event is emitted when the stream is ready to accept writes.</p>"
                },
                {
                  "textRaw": "Event: `'write'`",
                  "name": "write",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'write'</code> event is emitted when a write operation has completed. The number\nof bytes written is passed as the first argument to the event handler.</p>"
                }
              ],
              "signatures": [
                {
                  "textRaw": "`new fs.Utf8Stream([options])`",
                  "name": "fs.Utf8Stream",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`append`: {boolean} Appends writes to dest file instead of truncating it. **Default**: `true`.",
                          "name": "append",
                          "type": "boolean",
                          "desc": "Appends writes to dest file instead of truncating it. **Default**: `true`."
                        },
                        {
                          "textRaw": "`contentMode`: {string} Which type of data you can send to the write function, supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`.",
                          "name": "contentMode",
                          "type": "string",
                          "desc": "Which type of data you can send to the write function, supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`."
                        },
                        {
                          "textRaw": "`dest`: {string} A path to a file to be written to (mode controlled by the append option).",
                          "name": "dest",
                          "type": "string",
                          "desc": "A path to a file to be written to (mode controlled by the append option)."
                        },
                        {
                          "textRaw": "`fd`: {number} A file descriptor, something that is returned by `fs.open()` or `fs.openSync()`.",
                          "name": "fd",
                          "type": "number",
                          "desc": "A file descriptor, something that is returned by `fs.open()` or `fs.openSync()`."
                        },
                        {
                          "textRaw": "`fs`: {Object} An object that has the same API as the `fs` module, useful for mocking, testing, or customizing the behavior of the stream.",
                          "name": "fs",
                          "type": "Object",
                          "desc": "An object that has the same API as the `fs` module, useful for mocking, testing, or customizing the behavior of the stream."
                        },
                        {
                          "textRaw": "`fsync`: {boolean} Perform a `fs.fsyncSync()` every time a write is completed.",
                          "name": "fsync",
                          "type": "boolean",
                          "desc": "Perform a `fs.fsyncSync()` every time a write is completed."
                        },
                        {
                          "textRaw": "`maxLength`: {number} The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data",
                          "name": "maxLength",
                          "type": "number",
                          "desc": "The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data"
                        },
                        {
                          "textRaw": "`maxWrite`: {number} The maximum number of bytes that can be written; **Default**: `16384`",
                          "name": "maxWrite",
                          "type": "number",
                          "desc": "The maximum number of bytes that can be written; **Default**: `16384`"
                        },
                        {
                          "textRaw": "`minLength`: {number} The minimum length of the internal buffer that is required to be full before flushing.",
                          "name": "minLength",
                          "type": "number",
                          "desc": "The minimum length of the internal buffer that is required to be full before flushing."
                        },
                        {
                          "textRaw": "`mkdir`: {boolean} Ensure directory for `dest` file exists when true. **Default**: `false`.",
                          "name": "mkdir",
                          "type": "boolean",
                          "desc": "Ensure directory for `dest` file exists when true. **Default**: `false`."
                        },
                        {
                          "textRaw": "`mode`: {number|string} Specify the creating file mode (see `fs.open()`).",
                          "name": "mode",
                          "type": "number|string",
                          "desc": "Specify the creating file mode (see `fs.open()`)."
                        },
                        {
                          "textRaw": "`periodicFlush`: {number} Calls flush every `periodicFlush` milliseconds.",
                          "name": "periodicFlush",
                          "type": "number",
                          "desc": "Calls flush every `periodicFlush` milliseconds."
                        },
                        {
                          "textRaw": "`retryEAGAIN` {Function} A function that will be called when `write()`, `writeSync()`, or `flushSync()` encounters an `EAGAIN` or `EBUSY` error. If the return value is `true` the operation will be retried, otherwise it will bubble the error. The `err` is the error that caused this function to be called, `writeBufferLen` is the length of the buffer that was written, and `remainingBufferLen` is the length of the remaining buffer that the stream did not try to write.",
                          "name": "retryEAGAIN",
                          "type": "Function",
                          "desc": "A function that will be called when `write()`, `writeSync()`, or `flushSync()` encounters an `EAGAIN` or `EBUSY` error. If the return value is `true` the operation will be retried, otherwise it will bubble the error. The `err` is the error that caused this function to be called, `writeBufferLen` is the length of the buffer that was written, and `remainingBufferLen` is the length of the remaining buffer that the stream did not try to write.",
                          "options": [
                            {
                              "textRaw": "`err` {any} An error or `null`.",
                              "name": "err",
                              "type": "any",
                              "desc": "An error or `null`."
                            },
                            {
                              "textRaw": "`writeBufferLen` {number}",
                              "name": "writeBufferLen",
                              "type": "number"
                            },
                            {
                              "textRaw": "`remainingBufferLen`: {number}",
                              "name": "remainingBufferLen",
                              "type": "number"
                            }
                          ]
                        },
                        {
                          "textRaw": "`sync`: {boolean} Perform writes synchronously.",
                          "name": "sync",
                          "type": "boolean",
                          "desc": "Perform writes synchronously."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "{boolean} Whether the stream is appending to the file or truncating it.",
                  "name": "append",
                  "type": "boolean",
                  "desc": "Whether the stream is appending to the file or truncating it."
                },
                {
                  "textRaw": "{string} The type of data that can be written to the stream. Supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`.",
                  "name": "contentMode",
                  "type": "string",
                  "desc": "The type of data that can be written to the stream. Supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`."
                },
                {
                  "textRaw": "{number} The file descriptor that is being written to.",
                  "name": "fd",
                  "type": "number",
                  "desc": "The file descriptor that is being written to."
                },
                {
                  "textRaw": "{string} The file that is being written to.",
                  "name": "file",
                  "type": "string",
                  "desc": "The file that is being written to."
                },
                {
                  "textRaw": "{boolean} Whether the stream is performing a `fs.fsyncSync()` after every write operation.",
                  "name": "fsync",
                  "type": "boolean",
                  "desc": "Whether the stream is performing a `fs.fsyncSync()` after every write operation."
                },
                {
                  "textRaw": "{number} The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data.",
                  "name": "maxLength",
                  "type": "number",
                  "desc": "The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data."
                },
                {
                  "textRaw": "{number} The minimum length of the internal buffer that is required to be full before flushing.",
                  "name": "minLength",
                  "type": "number",
                  "desc": "The minimum length of the internal buffer that is required to be full before flushing."
                },
                {
                  "textRaw": "{boolean} Whether the stream should ensure that the directory for the `dest` file exists. If `true`, it will create the directory if it does not exist. **Default**: `false`.",
                  "name": "mkdir",
                  "type": "boolean",
                  "desc": "Whether the stream should ensure that the directory for the `dest` file exists. If `true`, it will create the directory if it does not exist. **Default**: `false`."
                },
                {
                  "textRaw": "{number|string} The mode of the file that is being written to.",
                  "name": "mode",
                  "type": "number|string",
                  "desc": "The mode of the file that is being written to."
                },
                {
                  "textRaw": "{number} The number of milliseconds between flushes. If set to `0`, no periodic flushes will be performed.",
                  "name": "periodicFlush",
                  "type": "number",
                  "desc": "The number of milliseconds between flushes. If set to `0`, no periodic flushes will be performed."
                },
                {
                  "textRaw": "{boolean} Whether the stream is writing synchronously or asynchronously.",
                  "name": "sync",
                  "type": "boolean",
                  "desc": "Whether the stream is writing synchronously or asynchronously."
                },
                {
                  "textRaw": "{boolean} Whether the stream is currently writing data to the file.",
                  "name": "writing",
                  "type": "boolean",
                  "desc": "Whether the stream is currently writing data to the file."
                }
              ],
              "methods": [
                {
                  "textRaw": "`utf8Stream.destroy()`",
                  "name": "destroy",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Close the stream immediately, without flushing the internal buffer.</p>"
                },
                {
                  "textRaw": "`utf8Stream.end()`",
                  "name": "end",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Close the stream gracefully, flushing the internal buffer before closing.</p>"
                },
                {
                  "textRaw": "`utf8Stream.flush(callback)`",
                  "name": "flush",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error|null} An error if the flush failed, otherwise `null`.",
                              "name": "err",
                              "type": "Error|null",
                              "desc": "An error if the flush failed, otherwise `null`."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Writes the current buffer to the file if a write was not in progress. Do\nnothing if <code>minLength</code> is zero or if it is already writing.</p>"
                },
                {
                  "textRaw": "`utf8Stream.flushSync()`",
                  "name": "flushSync",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Flushes the buffered data synchronously. This is a costly operation.</p>"
                },
                {
                  "textRaw": "`utf8Stream.reopen(file)`",
                  "name": "reopen",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "file"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li><code>file</code>: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> A path to a file to be written to (mode\ncontrolled by the append option).</li>\n</ul>\n<p>Reopen the file in place, useful for log rotation.</p>"
                },
                {
                  "textRaw": "`utf8Stream.write(data)`",
                  "name": "write",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer} The data to write.",
                          "name": "data",
                          "type": "string|Buffer",
                          "desc": "The data to write."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>When the <code>options.contentMode</code> is set to <code>'utf8'</code> when the stream is created,\nthe <code>data</code> argument must be a string. If the <code>contentMode</code> is set to <code>'buffer'</code>,\nthe <code>data</code> argument must be a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>"
                },
                {
                  "textRaw": "`utf8Stream[Symbol.dispose]()`",
                  "name": "[Symbol.dispose]",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>utf8Stream.destroy()</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.WriteStream`",
              "name": "fs.WriteStream",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"stream.html#class-streamwritable\"><code>&#x3C;stream.Writable></code></a></li>\n</ul>\n<p>Instances of <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a> cannot be constructed directly. They are created and\nreturned using the <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> function.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a>'s underlying file descriptor has been closed.</p>"
                },
                {
                  "textRaw": "Event: `'open'`",
                  "name": "open",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`fd` {integer} Integer file descriptor used by the {fs.WriteStream}.",
                      "name": "fd",
                      "type": "integer",
                      "desc": "Integer file descriptor used by the {fs.WriteStream}."
                    }
                  ],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a>'s file is opened.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v9.11.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a> is ready to be used.</p>\n<p>Fires immediately after <code>'open'</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`writeStream.bytesWritten`",
                  "name": "bytesWritten",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v0.4.7"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of bytes written so far. Does not include data that is still queued\nfor writing.</p>"
                },
                {
                  "textRaw": "`writeStream.path`",
                  "name": "path",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The path to the file the stream is writing to as specified in the first\nargument to <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>. If <code>path</code> is passed as a string, then\n<code>writeStream.path</code> will be a string. If <code>path</code> is passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, then <code>writeStream.path</code> will be a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pending",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v11.2.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This property is <code>true</code> if the underlying file has not been opened yet,\ni.e. before the <code>'ready'</code> event is emitted.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`writeStream.close([callback])`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Closes <code>writeStream</code>. Optionally accepts a\ncallback that will be executed once the <code>writeStream</code>\nis closed.</p>"
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "constants",
              "type": "Object",
              "desc": "<p>Returns an object containing commonly used constants for file system\noperations.</p>",
              "modules": [
                {
                  "textRaw": "FS constants",
                  "name": "fs_constants",
                  "type": "module",
                  "desc": "<p>The following constants are exported by <code>fs.constants</code> and <code>fsPromises.constants</code>.</p>\n<p>Not every constant will be available on every operating system;\nthis is especially important for Windows, where many of the POSIX specific\ndefinitions are not available.\nFor portable applications it is recommended to check for their presence\nbefore use.</p>\n<p>To use more than one constant, use the bitwise OR <code>|</code> operator.</p>\n<p>Example:</p>\n<pre><code class=\"language-mjs\">import { open, constants } from 'node:fs';\n\nconst {\n  O_RDWR,\n  O_CREAT,\n  O_EXCL,\n} = constants;\n\nopen('/path/to/my/file', O_RDWR | O_CREAT | O_EXCL, (err, fd) => {\n  // ...\n});\n</code></pre>",
                  "modules": [
                    {
                      "textRaw": "File access constants",
                      "name": "file_access_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use as the <code>mode</code> parameter passed to\n<a href=\"#fspromisesaccesspath-mode\"><code>fsPromises.access()</code></a>, <a href=\"#fsaccesspath-mode-callback\"><code>fs.access()</code></a>, and <a href=\"#fsaccesssyncpath-mode\"><code>fs.accessSync()</code></a>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>F_OK</code></td>\n    <td>Flag indicating that the file is visible to the calling process.\n     This is useful for determining if a file exists, but says nothing\n     about <code>rwx</code> permissions. Default if no mode is specified.</td>\n  </tr>\n  <tr>\n    <td><code>R_OK</code></td>\n    <td>Flag indicating that the file can be read by the calling process.</td>\n  </tr>\n  <tr>\n    <td><code>W_OK</code></td>\n    <td>Flag indicating that the file can be written by the calling\n    process.</td>\n  </tr>\n  <tr>\n    <td><code>X_OK</code></td>\n    <td>Flag indicating that the file can be executed by the calling\n    process. This has no effect on Windows\n    (will behave like <code>fs.constants.F_OK</code>).</td>\n  </tr>\n</table>\n<p>The definitions are also available on Windows.</p>",
                      "displayName": "File access constants"
                    },
                    {
                      "textRaw": "File copy constants",
                      "name": "file_copy_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with <a href=\"#fscopyfilesrc-dest-mode-callback\"><code>fs.copyFile()</code></a>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>COPYFILE_EXCL</code></td>\n    <td>If present, the copy operation will fail with an error if the\n    destination path already exists.</td>\n  </tr>\n  <tr>\n    <td><code>COPYFILE_FICLONE</code></td>\n    <td>If present, the copy operation will attempt to create a\n    copy-on-write reflink. If the underlying platform does not support\n    copy-on-write, then a fallback copy mechanism is used.</td>\n  </tr>\n  <tr>\n    <td><code>COPYFILE_FICLONE_FORCE</code></td>\n    <td>If present, the copy operation will attempt to create a\n    copy-on-write reflink. If the underlying platform does not support\n    copy-on-write, then the operation will fail with an error.</td>\n  </tr>\n</table>\n<p>The definitions are also available on Windows.</p>",
                      "displayName": "File copy constants"
                    },
                    {
                      "textRaw": "File open constants",
                      "name": "file_open_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with <code>fs.open()</code>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>O_RDONLY</code></td>\n    <td>Flag indicating to open a file for read-only access.</td>\n  </tr>\n  <tr>\n    <td><code>O_WRONLY</code></td>\n    <td>Flag indicating to open a file for write-only access.</td>\n  </tr>\n  <tr>\n    <td><code>O_RDWR</code></td>\n    <td>Flag indicating to open a file for read-write access.</td>\n  </tr>\n  <tr>\n    <td><code>O_CREAT</code></td>\n    <td>Flag indicating to create the file if it does not already exist.</td>\n  </tr>\n  <tr>\n    <td><code>O_EXCL</code></td>\n    <td>Flag indicating that opening a file should fail if the\n    <code>O_CREAT</code> flag is set and the file already exists.</td>\n  </tr>\n  <tr>\n    <td><code>O_NOCTTY</code></td>\n    <td>Flag indicating that if path identifies a terminal device, opening the\n    path shall not cause that terminal to become the controlling terminal for\n    the process (if the process does not already have one).</td>\n  </tr>\n  <tr>\n    <td><code>O_TRUNC</code></td>\n    <td>Flag indicating that if the file exists and is a regular file, and the\n    file is opened successfully for write access, its length shall be truncated\n    to zero.</td>\n  </tr>\n  <tr>\n    <td><code>O_APPEND</code></td>\n    <td>Flag indicating that data will be appended to the end of the file.</td>\n  </tr>\n  <tr>\n    <td><code>O_DIRECTORY</code></td>\n    <td>Flag indicating that the open should fail if the path is not a\n    directory.</td>\n  </tr>\n  <tr>\n  <td><code>O_NOATIME</code></td>\n    <td>Flag indicating reading accesses to the file system will no longer\n    result in an update to the <code>atime</code> information associated with\n    the file. This flag is available on Linux operating systems only.</td>\n  </tr>\n  <tr>\n    <td><code>O_NOFOLLOW</code></td>\n    <td>Flag indicating that the open should fail if the path is a symbolic\n    link.</td>\n  </tr>\n  <tr>\n    <td><code>O_SYNC</code></td>\n    <td>Flag indicating that the file is opened for synchronized I/O with write\n    operations waiting for file integrity.</td>\n  </tr>\n  <tr>\n    <td><code>O_DSYNC</code></td>\n    <td>Flag indicating that the file is opened for synchronized I/O with write\n    operations waiting for data integrity.</td>\n  </tr>\n  <tr>\n    <td><code>O_SYMLINK</code></td>\n    <td>Flag indicating to open the symbolic link itself rather than the\n    resource it is pointing to.</td>\n  </tr>\n  <tr>\n    <td><code>O_DIRECT</code></td>\n    <td>When set, an attempt will be made to minimize caching effects of file\n    I/O.</td>\n  </tr>\n  <tr>\n    <td><code>O_NONBLOCK</code></td>\n    <td>Flag indicating to open the file in nonblocking mode when possible.</td>\n  </tr>\n  <tr>\n    <td><code>UV_FS_O_FILEMAP</code></td>\n    <td>When set, a memory file mapping is used to access the file. This flag\n    is available on Windows operating systems only. On other operating systems,\n    this flag is ignored.</td>\n  </tr>\n</table>\n<p>On Windows, only <code>O_APPEND</code>, <code>O_CREAT</code>, <code>O_EXCL</code>, <code>O_RDONLY</code>, <code>O_RDWR</code>,\n<code>O_TRUNC</code>, <code>O_WRONLY</code>, and <code>UV_FS_O_FILEMAP</code> are available.</p>",
                      "displayName": "File open constants"
                    },
                    {
                      "textRaw": "File type constants",
                      "name": "file_type_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object's <code>mode</code> property for determining a file's type.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>S_IFMT</code></td>\n    <td>Bit mask used to extract the file type code.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFREG</code></td>\n    <td>File type constant for a regular file.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFDIR</code></td>\n    <td>File type constant for a directory.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFCHR</code></td>\n    <td>File type constant for a character-oriented device file.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFBLK</code></td>\n    <td>File type constant for a block-oriented device file.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFIFO</code></td>\n    <td>File type constant for a FIFO/pipe.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFLNK</code></td>\n    <td>File type constant for a symbolic link.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFSOCK</code></td>\n    <td>File type constant for a socket.</td>\n  </tr>\n</table>\n<p>On Windows, only <code>S_IFCHR</code>, <code>S_IFDIR</code>, <code>S_IFLNK</code>, <code>S_IFMT</code>, and <code>S_IFREG</code>,\nare available.</p>",
                      "displayName": "File type constants"
                    },
                    {
                      "textRaw": "File mode constants",
                      "name": "file_mode_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object's <code>mode</code> property for determining the access permissions for a file.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>S_IRWXU</code></td>\n    <td>File mode indicating readable, writable, and executable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRUSR</code></td>\n    <td>File mode indicating readable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IWUSR</code></td>\n    <td>File mode indicating writable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IXUSR</code></td>\n    <td>File mode indicating executable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRWXG</code></td>\n    <td>File mode indicating readable, writable, and executable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRGRP</code></td>\n    <td>File mode indicating readable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IWGRP</code></td>\n    <td>File mode indicating writable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IXGRP</code></td>\n    <td>File mode indicating executable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRWXO</code></td>\n    <td>File mode indicating readable, writable, and executable by others.</td>\n  </tr>\n  <tr>\n    <td><code>S_IROTH</code></td>\n    <td>File mode indicating readable by others.</td>\n  </tr>\n  <tr>\n    <td><code>S_IWOTH</code></td>\n    <td>File mode indicating writable by others.</td>\n  </tr>\n  <tr>\n    <td><code>S_IXOTH</code></td>\n    <td>File mode indicating executable by others.</td>\n  </tr>\n</table>\n<p>On Windows, only <code>S_IRUSR</code> and <code>S_IWUSR</code> are available.</p>",
                      "displayName": "File mode constants"
                    }
                  ],
                  "displayName": "FS constants"
                }
              ]
            }
          ],
          "displayName": "Common Objects"
        },
        {
          "textRaw": "Notes",
          "name": "notes",
          "type": "module",
          "modules": [
            {
              "textRaw": "Ordering of callback and promise-based operations",
              "name": "ordering_of_callback_and_promise-based_operations",
              "type": "module",
              "desc": "<p>Because they are executed asynchronously by the underlying thread pool,\nthere is no guaranteed ordering when using either the callback or\npromise-based methods.</p>\n<p>For example, the following is prone to error because the <code>fs.stat()</code>\noperation might complete before the <code>fs.rename()</code> operation:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\n\nfs.rename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  console.log('renamed complete');\n});\nfs.stat('/tmp/world', (err, stats) => {\n  if (err) throw err;\n  console.log(`stats: ${JSON.stringify(stats)}`);\n});\n</code></pre>\n<p>It is important to correctly order the operations by awaiting the results\nof one before invoking the other:</p>\n<pre><code class=\"language-mjs\">import { rename, stat } from 'node:fs/promises';\n\nconst oldPath = '/tmp/hello';\nconst newPath = '/tmp/world';\n\ntry {\n  await rename(oldPath, newPath);\n  const stats = await stat(newPath);\n  console.log(`stats: ${JSON.stringify(stats)}`);\n} catch (error) {\n  console.error('there was an error:', error.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { rename, stat } = require('node:fs/promises');\n\n(async function(oldPath, newPath) {\n  try {\n    await rename(oldPath, newPath);\n    const stats = await stat(newPath);\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  } catch (error) {\n    console.error('there was an error:', error.message);\n  }\n})('/tmp/hello', '/tmp/world');\n</code></pre>\n<p>Or, when using the callback APIs, move the <code>fs.stat()</code> call into the callback\nof the <code>fs.rename()</code> operation:</p>\n<pre><code class=\"language-mjs\">import { rename, stat } from 'node:fs';\n\nrename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  stat('/tmp/world', (err, stats) => {\n    if (err) throw err;\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { rename, stat } = require('node:fs/promises');\n\nrename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  stat('/tmp/world', (err, stats) => {\n    if (err) throw err;\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  });\n});\n</code></pre>",
              "displayName": "Ordering of callback and promise-based operations"
            },
            {
              "textRaw": "File paths",
              "name": "file_paths",
              "type": "module",
              "desc": "<p>Most <code>fs</code> operations accept file paths that may be specified in the form of\na string, a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, or a <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> object using the <code>file:</code> protocol.</p>",
              "modules": [
                {
                  "textRaw": "String paths",
                  "name": "string_paths",
                  "type": "module",
                  "desc": "<p>String paths are interpreted as UTF-8 character sequences identifying\nthe absolute or relative filename. Relative paths will be resolved relative\nto the current working directory as determined by calling <code>process.cwd()</code>.</p>\n<p>Example using an absolute path on POSIX:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet fd;\ntry {\n  fd = await open('/open/some/file.txt', 'r');\n  // Do something with the file\n} finally {\n  await fd?.close();\n}\n</code></pre>\n<p>Example using a relative path on POSIX (relative to <code>process.cwd()</code>):</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet fd;\ntry {\n  fd = await open('file.txt', 'r');\n  // Do something with the file\n} finally {\n  await fd?.close();\n}\n</code></pre>",
                  "displayName": "String paths"
                },
                {
                  "textRaw": "File URL paths",
                  "name": "file_url_paths",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v7.6.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>For most <code>node:fs</code> module functions, the <code>path</code> or <code>filename</code> argument may be\npassed as a <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> object using the <code>file:</code> protocol.</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\nreadFileSync(new URL('file:///tmp/hello'));\n</code></pre>\n<p><code>file:</code> URLs are always absolute paths.</p>",
                  "modules": [
                    {
                      "textRaw": "Platform-specific considerations",
                      "name": "platform-specific_considerations",
                      "type": "module",
                      "desc": "<p>On Windows, <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with a host name convert to UNC paths, while <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with drive letters convert to local absolute paths. <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s\nwith no host name and no drive letter will result in an error:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n// On Windows :\n\n// - WHATWG file URLs with hostname convert to UNC path\n// file://hostname/p/a/t/h/file => \\\\hostname\\p\\a\\t\\h\\file\nreadFileSync(new URL('file://hostname/p/a/t/h/file'));\n\n// - WHATWG file URLs with drive letters convert to absolute path\n// file:///C:/tmp/hello => C:\\tmp\\hello\nreadFileSync(new URL('file:///C:/tmp/hello'));\n\n// - WHATWG file URLs without hostname must have a drive letters\nreadFileSync(new URL('file:///notdriveletter/p/a/t/h/file'));\nreadFileSync(new URL('file:///c/p/a/t/h/file'));\n// TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute\n</code></pre>\n<p><code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with drive letters must use <code>:</code> as a separator just after\nthe drive letter. Using another separator will result in an error.</p>\n<p>On all other platforms, <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with a host name are unsupported and\nwill result in an error:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n// On other platforms:\n\n// - WHATWG file URLs with hostname are unsupported\n// file://hostname/p/a/t/h/file => throw!\nreadFileSync(new URL('file://hostname/p/a/t/h/file'));\n// TypeError [ERR_INVALID_FILE_URL_PATH]: must be absolute\n\n// - WHATWG file URLs convert to absolute path\n// file:///tmp/hello => /tmp/hello\nreadFileSync(new URL('file:///tmp/hello'));\n</code></pre>\n<p>A <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> having encoded slash characters will result in an error on all\nplatforms:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\n// On Windows\nreadFileSync(new URL('file:///C:/p/a/t/h/%2F'));\nreadFileSync(new URL('file:///C:/p/a/t/h/%2f'));\n/* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded\n\\ or / characters */\n\n// On POSIX\nreadFileSync(new URL('file:///p/a/t/h/%2F'));\nreadFileSync(new URL('file:///p/a/t/h/%2f'));\n/* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded\n/ characters */\n</code></pre>\n<p>On Windows, <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s having encoded backslash will result in an error:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\n// On Windows\nreadFileSync(new URL('file:///C:/path/%5C'));\nreadFileSync(new URL('file:///C:/path/%5c'));\n/* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded\n\\ or / characters */\n</code></pre>",
                      "displayName": "Platform-specific considerations"
                    }
                  ],
                  "displayName": "File URL paths"
                },
                {
                  "textRaw": "Buffer paths",
                  "name": "buffer_paths",
                  "type": "module",
                  "desc": "<p>Paths specified using a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> are useful primarily on certain POSIX\noperating systems that treat file paths as opaque byte sequences. On such\nsystems, it is possible for a single file path to contain sub-sequences that\nuse multiple character encodings. As with string paths, <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> paths may\nbe relative or absolute:</p>\n<p>Example using an absolute path on POSIX:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { Buffer } from 'node:buffer';\n\nlet fd;\ntry {\n  fd = await open(Buffer.from('/open/some/file.txt'), 'r');\n  // Do something with the file\n} finally {\n  await fd?.close();\n}\n</code></pre>",
                  "displayName": "Buffer paths"
                },
                {
                  "textRaw": "Per-drive working directories on Windows",
                  "name": "per-drive_working_directories_on_windows",
                  "type": "module",
                  "desc": "<p>On Windows, Node.js follows the concept of per-drive working directory. This\nbehavior can be observed when using a drive path without a backslash. For\nexample <code>fs.readdirSync('C:\\\\')</code> can potentially return a different result than\n<code>fs.readdirSync('C:')</code>. For more information, see\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths\">this MSDN page</a>.</p>",
                  "displayName": "Per-drive working directories on Windows"
                }
              ],
              "displayName": "File paths"
            },
            {
              "textRaw": "File descriptors",
              "name": "file_descriptors",
              "type": "module",
              "desc": "<p>On POSIX systems, for every process, the kernel maintains a table of currently\nopen files and resources. Each open file is assigned a simple numeric\nidentifier called a <em>file descriptor</em>. At the system-level, all file system\noperations use these file descriptors to identify and track each specific\nfile. Windows systems use a different but conceptually similar mechanism for\ntracking resources. To simplify things for users, Node.js abstracts away the\ndifferences between operating systems and assigns all open files a numeric file\ndescriptor.</p>\n<p>The callback-based <code>fs.open()</code>, and synchronous <code>fs.openSync()</code> methods open a\nfile and allocate a new file descriptor. Once allocated, the file descriptor may\nbe used to read data from, write data to, or request information about the file.</p>\n<p>Operating systems limit the number of file descriptors that may be open\nat any given time so it is critical to close the descriptor when operations\nare completed. Failure to do so will result in a memory leak that will\neventually cause an application to crash.</p>\n<pre><code class=\"language-mjs\">import { open, close, fstat } from 'node:fs';\n\nfunction closeFd(fd) {\n  close(fd, (err) => {\n    if (err) throw err;\n  });\n}\n\nopen('/open/some/file.txt', 'r', (err, fd) => {\n  if (err) throw err;\n  try {\n    fstat(fd, (err, stat) => {\n      if (err) {\n        closeFd(fd);\n        throw err;\n      }\n\n      // use stat\n\n      closeFd(fd);\n    });\n  } catch (err) {\n    closeFd(fd);\n    throw err;\n  }\n});\n</code></pre>\n<p>The promise-based APIs use a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> object in place of the numeric\nfile descriptor. These objects are better managed by the system to ensure\nthat resources are not leaked. However, it is still required that they are\nclosed when operations are completed:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet file;\ntry {\n  file = await open('/open/some/file.txt', 'r');\n  const stat = await file.stat();\n  // use stat\n} finally {\n  await file.close();\n}\n</code></pre>",
              "displayName": "File descriptors"
            },
            {
              "textRaw": "Threadpool usage",
              "name": "threadpool_usage",
              "type": "module",
              "desc": "<p>All callback and promise-based file system APIs (with the exception of\n<code>fs.FSWatcher()</code>) use libuv's threadpool. This can have surprising and negative\nperformance implications for some applications. See the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>",
              "displayName": "Threadpool usage"
            },
            {
              "textRaw": "File system flags",
              "name": "file_system_flags",
              "type": "module",
              "desc": "<p>The following flags are available wherever the <code>flag</code> option takes a\nstring.</p>\n<ul>\n<li>\n<p><code>'a'</code>: Open file for appending.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'ax'</code>: Like <code>'a'</code> but fails if the path exists.</p>\n</li>\n<li>\n<p><code>'a+'</code>: Open file for reading and appending.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'ax+'</code>: Like <code>'a+'</code> but fails if the path exists.</p>\n</li>\n<li>\n<p><code>'as'</code>: Open file for appending in synchronous mode.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'as+'</code>: Open file for reading and appending in synchronous mode.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'r'</code>: Open file for reading.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li>\n<p><code>'rs'</code>: Open file for reading in synchronous mode.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li>\n<p><code>'r+'</code>: Open file for reading and writing.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li>\n<p><code>'rs+'</code>: Open file for reading and writing in synchronous mode. Instructs\nthe operating system to bypass the local file system cache.</p>\n<p>This is primarily useful for opening files on NFS mounts as it allows\nskipping the potentially stale local cache. It has a very real impact on\nI/O performance so using this flag is not recommended unless it is needed.</p>\n<p>This doesn't turn <code>fs.open()</code> or <code>fsPromises.open()</code> into a synchronous\nblocking call. If synchronous operation is desired, something like\n<code>fs.openSync()</code> should be used.</p>\n</li>\n<li>\n<p><code>'w'</code>: Open file for writing.\nThe file is created (if it does not exist) or truncated (if it exists).</p>\n</li>\n<li>\n<p><code>'wx'</code>: Like <code>'w'</code> but fails if the path exists.</p>\n</li>\n<li>\n<p><code>'w+'</code>: Open file for reading and writing.\nThe file is created (if it does not exist) or truncated (if it exists).</p>\n</li>\n<li>\n<p><code>'wx+'</code>: Like <code>'w+'</code> but fails if the path exists.</p>\n</li>\n</ul>\n<p><code>flag</code> can also be a number as documented by <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a>; commonly used constants\nare available from <code>fs.constants</code>. On Windows, flags are translated to\ntheir equivalent ones where applicable, e.g. <code>O_WRONLY</code> to <code>FILE_GENERIC_WRITE</code>,\nor <code>O_EXCL|O_CREAT</code> to <code>CREATE_NEW</code>, as accepted by <code>CreateFileW</code>.</p>\n<p>The exclusive flag <code>'x'</code> (<code>O_EXCL</code> flag in <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a>) causes the operation to\nreturn an error if the path already exists. On POSIX, if the path is a symbolic\nlink, using <code>O_EXCL</code> returns an error even if the link is to a path that does\nnot exist. The exclusive flag might not work with network file systems.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>\n<p>Modifying a file rather than replacing it may require the <code>flag</code> option to be\nset to <code>'r+'</code> rather than the default <code>'w'</code>.</p>\n<p>The behavior of some flags are platform-specific. As such, opening a directory\non macOS and Linux with the <code>'a+'</code> flag, as in the example below, will return an\nerror. In contrast, on Windows and FreeBSD, a file descriptor or a <code>FileHandle</code>\nwill be returned.</p>\n<pre><code class=\"language-js\">// macOS and Linux\nfs.open('&#x3C;directory>', 'a+', (err, fd) => {\n  // => [Error: EISDIR: illegal operation on a directory, open &#x3C;directory>]\n});\n\n// Windows and FreeBSD\nfs.open('&#x3C;directory>', 'a+', (err, fd) => {\n  // => null, &#x3C;fd>\n});\n</code></pre>\n<p>On Windows, opening an existing hidden file using the <code>'w'</code> flag (either\nthrough <code>fs.open()</code>, <code>fs.writeFile()</code>, or <code>fsPromises.open()</code>) will fail with\n<code>EPERM</code>. Existing hidden files can be opened for writing with the <code>'r+'</code> flag.</p>\n<p>A call to <code>fs.ftruncate()</code> or <code>filehandle.truncate()</code> can be used to reset\nthe file contents.</p>",
              "displayName": "File system flags"
            }
          ],
          "displayName": "Notes"
        }
      ],
      "displayName": "File system"
    }
  ]
}