{
  "type": "module",
  "source": "doc/api/path.md",
  "modules": [
    {
      "textRaw": "Path",
      "name": "path",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:path</code> module provides utilities for working with file and directory\npaths. It can be accessed using:</p>\n<pre><code class=\"language-cjs\">const path = require('node:path');\n</code></pre>\n<pre><code class=\"language-mjs\">import path from 'node:path';\n</code></pre>",
      "modules": [
        {
          "textRaw": "Windows vs. POSIX",
          "name": "windows_vs._posix",
          "type": "module",
          "desc": "<p>The default operation of the <code>node:path</code> module varies based on the operating\nsystem on which a Node.js application is running. Specifically, when running on\na Windows operating system, the <code>node:path</code> module will assume that\nWindows-style paths are being used.</p>\n<p>So using <code>path.basename()</code> might yield different results on POSIX and Windows:</p>\n<p>On POSIX:</p>\n<pre><code class=\"language-js\">path.basename('C:\\\\temp\\\\myfile.html');\n// Returns: 'C:\\\\temp\\\\myfile.html'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.basename('C:\\\\temp\\\\myfile.html');\n// Returns: 'myfile.html'\n</code></pre>\n<p>To achieve consistent results when working with Windows file paths on any\noperating system, use <a href=\"#pathwin32\"><code>path.win32</code></a>:</p>\n<p>On POSIX and Windows:</p>\n<pre><code class=\"language-js\">path.win32.basename('C:\\\\temp\\\\myfile.html');\n// Returns: 'myfile.html'\n</code></pre>\n<p>To achieve consistent results when working with POSIX file paths on any\noperating system, use <a href=\"#pathposix\"><code>path.posix</code></a>:</p>\n<p>On POSIX and Windows:</p>\n<pre><code class=\"language-js\">path.posix.basename('/tmp/myfile.html');\n// Returns: 'myfile.html'\n</code></pre>\n<p>On Windows Node.js follows the concept of per-drive working directory.\nThis behavior can be observed when using a drive path without a backslash. For\nexample, <code>path.resolve('C:\\\\')</code> can potentially return a different result than\n<code>path.resolve('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": "Windows vs. POSIX"
        }
      ],
      "methods": [
        {
          "textRaw": "`path.basename(path[, suffix])`",
          "name": "basename",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5348",
                "description": "Passing a non-string as the `path` argument will throw now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                },
                {
                  "textRaw": "`suffix` {string} An optional suffix to remove",
                  "name": "suffix",
                  "type": "string",
                  "desc": "An optional suffix to remove",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.basename()</code> method returns the last portion of a <code>path</code>, similar to\nthe Unix <code>basename</code> command. Trailing <a href=\"#pathsep\">directory separators</a> are\nignored.</p>\n<pre><code class=\"language-js\">path.basename('/foo/bar/baz/asdf/quux.html');\n// Returns: 'quux.html'\n\npath.basename('/foo/bar/baz/asdf/quux.html', '.html');\n// Returns: 'quux'\n</code></pre>\n<p>Although Windows usually treats file names, including file extensions, in a\ncase-insensitive manner, this function does not. For example, <code>C:\\\\foo.html</code> and\n<code>C:\\\\foo.HTML</code> refer to the same file, but <code>basename</code> treats the extension as a\ncase-sensitive string:</p>\n<pre><code class=\"language-js\">path.win32.basename('C:\\\\foo.html', '.html');\n// Returns: 'foo'\n\npath.win32.basename('C:\\\\foo.HTML', '.html');\n// Returns: 'foo.HTML'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string or if <code>suffix</code> is given\nand is not a string.</p>"
        },
        {
          "textRaw": "`path.dirname(path)`",
          "name": "dirname",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5348",
                "description": "Passing a non-string as the `path` argument will throw now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.dirname()</code> method returns the directory name of a <code>path</code>, similar to\nthe Unix <code>dirname</code> command. Trailing directory separators are ignored, see\n<a href=\"#pathsep\"><code>path.sep</code></a>.</p>\n<pre><code class=\"language-js\">path.dirname('/foo/bar/baz/asdf/quux');\n// Returns: '/foo/bar/baz/asdf'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.extname(path)`",
          "name": "extname",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5348",
                "description": "Passing a non-string as the `path` argument will throw now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.extname()</code> method returns the extension of the <code>path</code>, from the last\noccurrence of the <code>.</code> (period) character to end of string in the last portion of\nthe <code>path</code>. If there is no <code>.</code> in the last portion of the <code>path</code>, or if\nthere are no <code>.</code> characters other than the first character of\nthe basename of <code>path</code> (see <code>path.basename()</code>) , an empty string is returned.</p>\n<pre><code class=\"language-js\">path.extname('index.html');\n// Returns: '.html'\n\npath.extname('index.coffee.md');\n// Returns: '.md'\n\npath.extname('index.');\n// Returns: '.'\n\npath.extname('index');\n// Returns: ''\n\npath.extname('.index');\n// Returns: ''\n\npath.extname('.index.md');\n// Returns: '.md'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.format(pathObject)`",
          "name": "format",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": [
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/44349",
                "description": "The dot will be added if it is not specified in `ext`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pathObject` {Object} Any JavaScript object having the following properties:",
                  "name": "pathObject",
                  "type": "Object",
                  "desc": "Any JavaScript object having the following properties:",
                  "options": [
                    {
                      "textRaw": "`dir` {string}",
                      "name": "dir",
                      "type": "string"
                    },
                    {
                      "textRaw": "`root` {string}",
                      "name": "root",
                      "type": "string"
                    },
                    {
                      "textRaw": "`base` {string}",
                      "name": "base",
                      "type": "string"
                    },
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`ext` {string}",
                      "name": "ext",
                      "type": "string"
                    }
                  ]
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.format()</code> method returns a path string from an object. This is the\nopposite of <a href=\"#pathparsepath\"><code>path.parse()</code></a>.</p>\n<p>When providing properties to the <code>pathObject</code> remember that there are\ncombinations where one property has priority over another:</p>\n<ul>\n<li><code>pathObject.root</code> is ignored if <code>pathObject.dir</code> is provided</li>\n<li><code>pathObject.ext</code> and <code>pathObject.name</code> are ignored if <code>pathObject.base</code> exists</li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">// If `dir`, `root` and `base` are provided,\n// `${dir}${path.sep}${base}`\n// will be returned. `root` is ignored.\npath.format({\n  root: '/ignored',\n  dir: '/home/user/dir',\n  base: 'file.txt',\n});\n// Returns: '/home/user/dir/file.txt'\n\n// `root` will be used if `dir` is not specified.\n// If only `root` is provided or `dir` is equal to `root` then the\n// platform separator will not be included. `ext` will be ignored.\npath.format({\n  root: '/',\n  base: 'file.txt',\n  ext: 'ignored',\n});\n// Returns: '/file.txt'\n\n// `name` + `ext` will be used if `base` is not specified.\npath.format({\n  root: '/',\n  name: 'file',\n  ext: '.txt',\n});\n// Returns: '/file.txt'\n\n// The dot will be added if it is not specified in `ext`.\npath.format({\n  root: '/',\n  name: 'file',\n  ext: 'txt',\n});\n// Returns: '/file.txt'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.format({\n  dir: 'C:\\\\path\\\\dir',\n  base: 'file.txt',\n});\n// Returns: 'C:\\\\path\\\\dir\\\\file.txt'\n</code></pre>"
        },
        {
          "textRaw": "`path.matchesGlob(path, pattern)`",
          "name": "matchesGlob",
          "type": "method",
          "meta": {
            "added": [
              "v22.5.0",
              "v20.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.8.0",
                  "v22.20.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59572",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string} The path to glob-match against.",
                  "name": "path",
                  "type": "string",
                  "desc": "The path to glob-match against."
                },
                {
                  "textRaw": "`pattern` {string} The glob to check the path against.",
                  "name": "pattern",
                  "type": "string",
                  "desc": "The glob to check the path against."
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean} Whether or not the `path` matched the `pattern`.",
                "name": "return",
                "type": "boolean",
                "desc": "Whether or not the `path` matched the `pattern`."
              }
            }
          ],
          "desc": "<p>The <code>path.matchesGlob()</code> method determines if <code>path</code> matches the <code>pattern</code>.</p>\n<p>For example:</p>\n<pre><code class=\"language-js\">path.matchesGlob('/foo/bar', '/foo/*'); // true\npath.matchesGlob('/foo/bar*', 'foo/bird'); // false\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> or <code>pattern</code> are not strings.</p>"
        },
        {
          "textRaw": "`path.isAbsolute(path)`",
          "name": "isAbsolute",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.2"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>The <code>path.isAbsolute()</code> method determines if the literal <code>path</code> is absolute.\nTherefore, it’s not safe for mitigating path traversals.</p>\n<p>If the given <code>path</code> is a zero-length string, <code>false</code> will be returned.</p>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.isAbsolute('/foo/bar');   // true\npath.isAbsolute('/baz/..');    // true\npath.isAbsolute('/baz/../..'); // true\npath.isAbsolute('qux/');       // false\npath.isAbsolute('.');          // false\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.isAbsolute('//server');    // true\npath.isAbsolute('\\\\\\\\server');  // true\npath.isAbsolute('C:/foo/..');   // true\npath.isAbsolute('C:\\\\foo\\\\..'); // true\npath.isAbsolute('bar\\\\baz');    // false\npath.isAbsolute('bar/baz');     // false\npath.isAbsolute('.');           // false\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.join([...paths])`",
          "name": "join",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`...paths` {string} A sequence of path segments",
                  "name": "...paths",
                  "type": "string",
                  "desc": "A sequence of path segments",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.join()</code> method joins all given <code>path</code> segments together using the\nplatform-specific separator as a delimiter, then normalizes the resulting path.</p>\n<p>Zero-length <code>path</code> segments are ignored. If the joined path string is a\nzero-length string then <code>'.'</code> will be returned, representing the current\nworking directory.</p>\n<pre><code class=\"language-js\">path.join('/foo', 'bar', 'baz/asdf', 'quux', '..');\n// Returns: '/foo/bar/baz/asdf'\n\npath.join('foo', {}, 'bar');\n// Throws 'TypeError: Path must be a string. Received {}'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if any of the path segments is not a string.</p>"
        },
        {
          "textRaw": "`path.normalize(path)`",
          "name": "normalize",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.23"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.normalize()</code> method normalizes the given <code>path</code>, resolving <code>'..'</code> and\n<code>'.'</code> segments.</p>\n<p>When multiple, sequential path segment separation characters are found (e.g.\n<code>/</code> on POSIX and either <code>\\</code> or <code>/</code> on Windows), they are replaced by a single\ninstance of the platform-specific path segment separator (<code>/</code> on POSIX and\n<code>\\</code> on Windows). Trailing separators are preserved.</p>\n<p>If the <code>path</code> is a zero-length string, <code>'.'</code> is returned, representing the\ncurrent working directory.</p>\n<p>On POSIX, the types of normalization applied by this function do not strictly\nadhere to the POSIX specification. For example, this function will replace two\nleading forward slashes with a single slash as if it was a regular absolute\npath, whereas a few POSIX systems assign special meaning to paths beginning with\nexactly two forward slashes. Similarly, other substitutions performed by this\nfunction, such as removing <code>..</code> segments, may change how the underlying system\nresolves the path.</p>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.normalize('/foo/bar//baz/asdf/quux/..');\n// Returns: '/foo/bar/baz/asdf'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.normalize('C:\\\\temp\\\\\\\\foo\\\\bar\\\\..\\\\');\n// Returns: 'C:\\\\temp\\\\foo\\\\'\n</code></pre>\n<p>Since Windows recognizes multiple path separators, both separators will be\nreplaced by instances of the Windows preferred separator (<code>\\</code>):</p>\n<pre><code class=\"language-js\">path.win32.normalize('C:////temp\\\\\\\\/\\\\/\\\\/foo/bar');\n// Returns: 'C:\\\\temp\\\\foo\\\\bar'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.parse(path)`",
          "name": "parse",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>The <code>path.parse()</code> method returns an object whose properties represent\nsignificant elements of the <code>path</code>. Trailing directory separators are ignored,\nsee <a href=\"#pathsep\"><code>path.sep</code></a>.</p>\n<p>The returned object will have the following properties:</p>\n<ul>\n<li><code>dir</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>root</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>base</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>ext</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.parse('/home/user/dir/file.txt');\n// Returns:\n// { root: '/',\n//   dir: '/home/user/dir',\n//   base: 'file.txt',\n//   ext: '.txt',\n//   name: 'file' }\n</code></pre>\n<pre><code class=\"language-text\">┌─────────────────────┬────────────┐\n│          dir        │    base    │\n├──────┬              ├──────┬─────┤\n│ root │              │ name │ ext │\n\"  /    home/user/dir / file  .txt \"\n└──────┴──────────────┴──────┴─────┘\n(All spaces in the \"\" line should be ignored. They are purely for formatting.)\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.parse('C:\\\\path\\\\dir\\\\file.txt');\n// Returns:\n// { root: 'C:\\\\',\n//   dir: 'C:\\\\path\\\\dir',\n//   base: 'file.txt',\n//   ext: '.txt',\n//   name: 'file' }\n</code></pre>\n<pre><code class=\"language-text\">┌─────────────────────┬────────────┐\n│          dir        │    base    │\n├──────┬              ├──────┬─────┤\n│ root │              │ name │ ext │\n\" C:\\      path\\dir   \\ file  .txt \"\n└──────┴──────────────┴──────┴─────┘\n(All spaces in the \"\" line should be ignored. They are purely for formatting.)\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.relative(from, to)`",
          "name": "relative",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": [
              {
                "version": "v6.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/8523",
                "description": "On Windows, the leading slashes for UNC paths are now included in the return value."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`from` {string}",
                  "name": "from",
                  "type": "string"
                },
                {
                  "textRaw": "`to` {string}",
                  "name": "to",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.relative()</code> method returns the relative path from <code>from</code> to <code>to</code> based\non the current working directory. If <code>from</code> and <code>to</code> each resolve to the same\npath (after calling <code>path.resolve()</code> on each), a zero-length string is returned.</p>\n<p>If a zero-length string is passed as <code>from</code> or <code>to</code>, the current working\ndirectory will be used instead of the zero-length strings.</p>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb');\n// Returns: '../../impl/bbb'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.relative('C:\\\\orandea\\\\test\\\\aaa', 'C:\\\\orandea\\\\impl\\\\bbb');\n// Returns: '..\\\\..\\\\impl\\\\bbb'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if either <code>from</code> or <code>to</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.resolve([...paths])`",
          "name": "resolve",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`...paths` {string} A sequence of paths or path segments",
                  "name": "...paths",
                  "type": "string",
                  "desc": "A sequence of paths or path segments",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.resolve()</code> method resolves a sequence of paths or path segments into\nan absolute path.</p>\n<p>The given sequence of paths is processed from right to left, with each\nsubsequent <code>path</code> prepended until an absolute path is constructed.\nFor instance, given the sequence of path segments: <code>/foo</code>, <code>/bar</code>, <code>baz</code>,\ncalling <code>path.resolve('/foo', '/bar', 'baz')</code> would return <code>/bar/baz</code>\nbecause <code>'baz'</code> is not an absolute path but <code>'/bar' + '/' + 'baz'</code> is.</p>\n<p>If, after processing all given <code>path</code> segments, an absolute path has not yet\nbeen generated, the current working directory is used.</p>\n<p>The resulting path is normalized and trailing slashes are removed unless the\npath is resolved to the root directory.</p>\n<p>Zero-length <code>path</code> segments are ignored.</p>\n<p>If no <code>path</code> segments are passed, <code>path.resolve()</code> will return the absolute path\nof the current working directory.</p>\n<pre><code class=\"language-js\">path.resolve('/foo/bar', './baz');\n// Returns: '/foo/bar/baz'\n\npath.resolve('/foo/bar', '/tmp/file/');\n// Returns: '/tmp/file'\n\npath.resolve('wwwroot', 'static_files/png/', '../gif/image.gif');\n// If the current working directory is /home/myself/node,\n// this returns '/home/myself/node/wwwroot/static_files/gif/image.gif'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if any of the arguments is not a string.</p>"
        },
        {
          "textRaw": "`path.toNamespacedPath(path)`",
          "name": "toNamespacedPath",
          "type": "method",
          "meta": {
            "added": [
              "v9.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>On Windows systems only, returns an equivalent <a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#namespaces\">namespace-prefixed path</a> for\nthe given <code>path</code>. If <code>path</code> is not a string, <code>path</code> will be returned without\nmodifications.</p>\n<p>This method is meaningful only on Windows systems. On POSIX systems, the\nmethod is non-operational and always returns <code>path</code> without modifications.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {string}",
          "name": "delimiter",
          "type": "string",
          "meta": {
            "added": [
              "v0.9.3"
            ],
            "changes": []
          },
          "desc": "<p>Provides the platform-specific path delimiter:</p>\n<ul>\n<li><code>;</code> for Windows</li>\n<li><code>:</code> for POSIX</li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">console.log(process.env.PATH);\n// Prints: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'\n\nprocess.env.PATH.split(path.delimiter);\n// Returns: ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">console.log(process.env.PATH);\n// Prints: 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\'\n\nprocess.env.PATH.split(path.delimiter);\n// Returns ['C:\\\\Windows\\\\system32', 'C:\\\\Windows', 'C:\\\\Program Files\\\\node\\\\']\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "posix",
          "type": "Object",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": [
              {
                "version": "v15.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/34962",
                "description": "Exposed as `require('path/posix')`."
              }
            ]
          },
          "desc": "<p>The <code>path.posix</code> property provides access to POSIX specific implementations\nof the <code>path</code> methods.</p>\n<p>The API is accessible via <code>require('node:path').posix</code> or <code>require('node:path/posix')</code>.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "sep",
          "type": "string",
          "meta": {
            "added": [
              "v0.7.9"
            ],
            "changes": []
          },
          "desc": "<p>Provides the platform-specific path segment separator:</p>\n<ul>\n<li><code>\\</code> on Windows</li>\n<li><code>/</code> on POSIX</li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">'foo/bar/baz'.split(path.sep);\n// Returns: ['foo', 'bar', 'baz']\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">'foo\\\\bar\\\\baz'.split(path.sep);\n// Returns: ['foo', 'bar', 'baz']\n</code></pre>\n<p>On Windows, both the forward slash (<code>/</code>) and backward slash (<code>\\</code>) are accepted\nas path segment separators; however, the <code>path</code> methods only add backward\nslashes (<code>\\</code>).</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "win32",
          "type": "Object",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": [
              {
                "version": "v15.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/34962",
                "description": "Exposed as `require('path/win32')`."
              }
            ]
          },
          "desc": "<p>The <code>path.win32</code> property provides access to Windows-specific implementations\nof the <code>path</code> methods.</p>\n<p>The API is accessible via <code>require('node:path').win32</code> or <code>require('node:path/win32')</code>.</p>"
        }
      ],
      "displayName": "Path"
    }
  ]
}