Lines Matching full:path
7 <title>Path | Node.js v18.20.1 Documentation</title>
11 <link rel="canonical" href="https://nodejs.org/api/path.html">
15 <body class="alt apidoc" id="api-section-path">
62 <li><a href="path.html" class="nav-path active">Path</a></li>
96 <div id="column1" data-id="path" class="interior">
102 <path fill="none" d="M0 0h24v24H0z" />
103 <path d="M11.1 12.08c-2.33-4.51-.5-8.48.53-10.07C6.27 2.2 1.98 6.59 1.98 12c0 .14.02.28.02.42.62-.27 1.29-.42 2-.42 1.66 0 3.18.83 4.1 2.15A4.01 4.01 0 0111 18c0 1.52-.87 2.83-2.12 3.51.98.32 2.03.5 3.11.5 3.5 0 6.58-1.8 8.37-4.52-2.36.23-6.98-.97-9.26-5.41z"/>
104 <path d="M7 16h-.18C6.4 14.84 5.3 14 4 14c-1.66 0-3 1.34-3 3s1.34 3 3 3h3c1.1 0 2-.9 2-2s-.9-2-2-2z"/>
107 <path d="M0 0h24v24H0z" fill="none" />
108 <path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"/>
123 <li><span class="stability_2"><a href="#path">Path</a></span>
126 <li><a href="#pathbasenamepath-suffix"><code>path.basename(path[, suffix])</code></a></li>
127 <li><a href="#pathdelimiter"><code>path.delimiter</code></a></li>
128 <li><a href="#pathdirnamepath"><code>path.dirname(path)</code></a></li>
129 <li><a href="#pathextnamepath"><code>path.extname(path)</code></a></li>
130 <li><a href="#pathformatpathobject"><code>path.format(pathObject)</code></a></li>
131 <li><a href="#pathisabsolutepath"><code>path.isAbsolute(path)</code></a></li>
132 <li><a href="#pathjoinpaths"><code>path.join([...paths])</code></a></li>
133 <li><a href="#pathnormalizepath"><code>path.normalize(path)</code></a></li>
134 <li><a href="#pathparsepath"><code>path.parse(path)</code></a></li>
135 <li><a href="#pathposix"><code>path.posix</code></a></li>
136 <li><a href="#pathrelativefrom-to"><code>path.relative(from, to)</code></a></li>
137 <li><a href="#pathresolvepaths"><code>path.resolve([...paths])</code></a></li>
138 <li><a href="#pathsep"><code>path.sep</code></a></li>
139 <li><a href="#pathtonamespacedpathpath"><code>path.toNamespacedPath(path)</code></a></li>
140 <li><a href="#pathwin32"><code>path.win32</code></a></li>
197 <li><a href="path.html" class="nav-path active">Path</a></li>
237 <div class="picker"><ol id="alt-docs"><li><a href="https://nodejs.org/docs/latest-v21.x/api/path.html">21.x</a></li>
238 <li><a href="https://nodejs.org/docs/latest-v20.x/api/path.html">20.x <b>LTS</b></a></li>
239 <li><a href="https://nodejs.org/docs/latest-v19.x/api/path.html">19.x</a></li>
240 <li><a href="https://nodejs.org/docs/latest-v18.x/api/path.html">18.x <b>LTS</b></a></li>
241 <li><a href="https://nodejs.org/docs/latest-v17.x/api/path.html">17.x</a></li>
242 <li><a href="https://nodejs.org/docs/latest-v16.x/api/path.html">16.x</a></li>
243 <li><a href="https://nodejs.org/docs/latest-v15.x/api/path.html">15.x</a></li>
244 <li><a href="https://nodejs.org/docs/latest-v14.x/api/path.html">14.x</a></li>
245 <li><a href="https://nodejs.org/docs/latest-v13.x/api/path.html">13.x</a></li>
246 <li><a href="https://nodejs.org/docs/latest-v12.x/api/path.html">12.x</a></li>
247 <li><a href="https://nodejs.org/docs/latest-v11.x/api/path.html">11.x</a></li>
248 <li><a href="https://nodejs.org/docs/latest-v10.x/api/path.html">10.x</a></li>
249 <li><a href="https://nodejs.org/docs/latest-v9.x/api/path.html">9.x</a></li>
250 <li><a href="https://nodejs.org/docs/latest-v8.x/api/path.html">8.x</a></li>
251 <li><a href="https://nodejs.org/docs/latest-v7.x/api/path.html">7.x</a></li>
252 <li><a href="https://nodejs.org/docs/latest-v6.x/api/path.html">6.x</a></li>
253 <li><a href="https://nodejs.org/docs/latest-v5.x/api/path.html">5.x</a></li>
254 <li><a href="https://nodejs.org/docs/latest-v4.x/api/path.html">4.x</a></li>
255 <li><a href="https://nodejs.org/docs/latest-v0.12.x/api/path.html">0.12.x</a></li>
256 <li><a href="https://nodejs.org/docs/latest-v0.10.x/api/path.html">0.10.x</a></li></ol></div>
271 <a href="path.json">View as JSON</a>
273 <li class="edit_on_github"><a href="https://github.com/nodejs/node/edit/main/doc/api/path.md">Edit on GitHub</a></li>
283 <li><span class="stability_2"><a href="#path">Path</a></span>
286 <li><a href="#pathbasenamepath-suffix"><code>path.basename(path[, suffix])</code></a></li>
287 <li><a href="#pathdelimiter"><code>path.delimiter</code></a></li>
288 <li><a href="#pathdirnamepath"><code>path.dirname(path)</code></a></li>
289 <li><a href="#pathextnamepath"><code>path.extname(path)</code></a></li>
290 <li><a href="#pathformatpathobject"><code>path.format(pathObject)</code></a></li>
291 <li><a href="#pathisabsolutepath"><code>path.isAbsolute(path)</code></a></li>
292 <li><a href="#pathjoinpaths"><code>path.join([...paths])</code></a></li>
293 <li><a href="#pathnormalizepath"><code>path.normalize(path)</code></a></li>
294 <li><a href="#pathparsepath"><code>path.parse(path)</code></a></li>
295 <li><a href="#pathposix"><code>path.posix</code></a></li>
296 <li><a href="#pathrelativefrom-to"><code>path.relative(from, to)</code></a></li>
297 <li><a href="#pathresolvepaths"><code>path.resolve([...paths])</code></a></li>
298 <li><a href="#pathsep"><code>path.sep</code></a></li>
299 <li><a href="#pathtonamespacedpathpath"><code>path.toNamespacedPath(path)</code></a></li>
300 <li><a href="#pathwin32"><code>path.win32</code></a></li>
306 <h2>Path<span><a class="mark" href="#path" id="path">#</a></span><a aria-hidden="true" class="legacy" id="path_path"></a></h2>
309 <p><strong>Source Code:</strong> <a href="https://github.com/nodejs/node/blob/v18.20.1/lib/path.js">lib/path.js</a></p>
310 <p>The <code>node:path</code> module provides utilities for working with file and directory
312 <pre><code class="language-js"><span class="hljs-keyword">const</span> path = <span class="hljs-built_in">require</span>(<span class="hljs-string">'node:path'</span>);</code> <button class="copy-button">copy</button></pre>
314 <p>The default operation of the <code>node:path</code> module varies based on the operating
316 a Windows operating system, the <code>node:path</code> module will assume that
318 <p>So using <code>path.basename()</code> might yield different results on POSIX and Windows:</p>
320 <pre><code class="language-js">path.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'C:\\temp\\myfile.html'</span>);
323 <pre><code class="language-js">path.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'C:\\temp\\myfile.html'</span>);
326 operating system, use <a href="#pathwin32"><code>path.win32</code></a>:</p>
328 <pre><code class="language-js">path.<span class="hljs-property">win32</span>.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'C:\\temp\\myfile.html'</span>);
331 operating system, use <a href="#pathposix"><code>path.posix</code></a>:</p>
333 <pre><code class="language-js">path.<span class="hljs-property">posix</span>.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'/tmp/myfile.html'</span>);
336 This behavior can be observed when using a drive path without a backslash. For
337 example, <code>path.resolve('C:\\')</code> can potentially return a different result than
338 <code>path.resolve('C:')</code>. For more information, see
340 </section><section><h3><code>path.basename(path[, suffix])</code><span><a class="mark" href="#pathbasenamepath-suffix" id="pathbasenamepath-suffix">#</a></span><a aria-hidden="true" class="legacy" id="path_path_basename_path_suffix"></a></h3>
346 <td><p>Passing a non-string as the <code>path</code> argument will throw now.</p></td></tr>
353 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
357 <p>The <code>path.basename()</code> method returns the last portion of a <code>path</code>, similar to
360 <pre><code class="language-js">path.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'/foo/bar/baz/asdf/quux.html'</span>);
363 path.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'/foo/bar/baz/asdf/quux.html'</span>, <span class="hljs-string">'.html'</span>);
369 <pre><code class="language-js">path.<span class="hljs-property">win32</span>.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'C:\\foo.html'</span>, <span class="hljs-string">'.html'</span>);
372 path.<span class="hljs-property">win32</span>.<span class="hljs-title function_">basename</span>(<span class="hljs-string">'C:\\foo.HTML'</span>, <span class="hljs-string">'.html'</span>);
374 <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
376 </section><section><h3><code>path.delimiter</code><span><a class="mark" href="#pathdelimiter" id="pathdelimiter">#</a></span><a aria-hidden="true" class="legacy" id="path_path_delimiter"></a></h3>
383 <p>Provides the platform-specific path delimiter:</p>
389 <pre><code class="language-js"><span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(process.<span class="hljs-property">env</span>.<span class="hljs-property">PATH</span>);
392 process.<span class="hljs-property">env</span>.<span class="hljs-property">PATH</span>.<span class="hljs-title function_">split</span>(path.<span class="hljs-property">delimiter</span>);
395 <pre><code class="language-js"><span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(process.<span class="hljs-property">env</span>.<span class="hljs-property">PATH</span>);
398 process.<span class="hljs-property">env</span>.<span class="hljs-property">PATH</span>.<span class="hljs-title function_">split</span>(path.<span class="hljs-property">delimiter</span>);
400 </section><section><h3><code>path.dirname(path)</code><span><a class="mark" href="#pathdirnamepath" id="pathdirnamepath">#</a></span><a aria-hidden="true" class="legacy" id="path_path_dirname_path"></a></h3>
406 <td><p>Passing a non-string as the <code>path</code> argument will throw now.</p></td></tr>
413 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
416 <p>The <code>path.dirname()</code> method returns the directory name of a <code>path</code>, similar to
418 <a href="#pathsep"><code>path.sep</code></a>.</p>
419 <pre><code class="language-js">path.<span class="hljs-title function_">dirname</span>(<span class="hljs-string">'/foo/bar/baz/asdf/quux'</span>);
421 <p>A <a href="errors.html#class-typeerror"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>
422 </section><section><h3><code>path.extname(path)</code><span><a class="mark" href="#pathextnamepath" id="pathextnamepath">#</a></span><a aria-hidden="true" class="legacy" id="path_path_extname_path"></a></h3>
428 <td><p>Passing a non-string as the <code>path</code> argument will throw now.</p></td></tr>
435 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
438 <p>The <code>path.extname()</code> method returns the extension of the <code>path</code>, from the last
440 the <code>path</code>. If there is no <code>.</code> in the last portion of the <code>path</code>, or if
442 the basename of <code>path</code> (see <code>path.basename()</code>) , an empty string is returned.</p>
443 <pre><code class="language-js">path.<span class="hljs-title function_">extname</span>(<span class="hljs-string">'index.html'</span>);
446 path.<span class="hljs-title function_">extname</span>(<span class="hljs-string">'index.coffee.md'</span>);
449 path.<span class="hljs-title function_">extname</span>(<span class="hljs-string">'index.'</span>);
452 path.<span class="hljs-title function_">extname</span>(<span class="hljs-string">'index'</span>);
455 path.<span class="hljs-title function_">extname</span>(<span class="hljs-string">'.index'</span>);
458 path.<span class="hljs-title function_">extname</span>(<span class="hljs-string">'.index.md'</span>);
460 <p>A <a href="errors.html#class-typeerror"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>
461 </section><section><h3><code>path.format(pathObject)</code><span><a class="mark" href="#pathformatpathobject" id="pathformatpathobject">#</a></span><a aria-hidden="true" class="legacy" id="path_path_format_pathobject"></a></h3>
477 <p>The <code>path.format()</code> method returns a path string from an object. This is the
478 opposite of <a href="#pathparsepath"><code>path.parse()</code></a>.</p>
487 <span class="hljs-comment">// `${dir}${path.sep}${base}`</span>
489 path.<span class="hljs-title function_">format</span>({
499 path.<span class="hljs-title function_">format</span>({
507 path.<span class="hljs-title function_">format</span>({
514 <pre><code class="language-js">path.<span class="hljs-title function_">format</span>({
515 <span class="hljs-attr">dir</span>: <span class="hljs-string">'C:\\path\\dir'</span>,
518 <span class="hljs-comment">// Returns: 'C:\\path\\dir\\file.txt'</span></code> <button class="copy-button">copy</button></pre>
519 </section><section><h3><code>path.isAbsolute(path)</code><span><a class="mark" href="#pathisabsolutepath" id="pathisabsolutepath">#</a></span><a aria-hidden="true" class="legacy" id="path_path_isabsolute_path"></a></h3>
524 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
527 <p>The <code>path.isAbsolute()</code> method determines if <code>path</code> is an absolute path.</p>
528 <p>If the given <code>path</code> is a zero-length string, <code>false</code> will be returned.</p>
530 <pre><code class="language-js">path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'/foo/bar'</span>); <span class="hljs-comment">// true</span>
531 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'/baz/..'</span>); <span class="hljs-comment">// true</span>
532 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'qux/'</span>); <span class="hljs-comment">// false</span>
533 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'.'</span>); <span class="hljs-comment">// false</span></code> <button class="copy-button">copy</button></pre>
535 <pre><code class="language-js">path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'//server'</span>); <span class="hljs-comment">// true</span>
536 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'\\\\server'</span>); <span class="hljs-comment">// true</span>
537 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'C:/foo/..'</span>); <span class="hljs-comment">// true</span>
538 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'C:\\foo\\..'</span>); <span class="hljs-comment">// true</span>
539 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'bar\\baz'</span>); <span class="hljs-comment">// false</span>
540 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'bar/baz'</span>); <span class="hljs-comment">// false</span>
541 path.<span class="hljs-title function_">isAbsolute</span>(<span class="hljs-string">'.'</span>); <span class="hljs-comment">// false</span></code> <button class="copy-button">copy</button></pre>
542 <p>A <a href="errors.html#class-typeerror"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>
543 </section><section><h3><code>path.join([...paths])</code><span><a class="mark" href="#pathjoinpaths" id="pathjoinpaths">#</a></span><a aria-hidden="true" class="legacy" id="path_path_join_paths"></a></h3>
548 <li><code>...paths</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> A sequence of path segments</li>
551 <p>The <code>path.join()</code> method joins all given <code>path</code> segments together using the
552 platform-specific separator as a delimiter, then normalizes the resulting path.</p>
553 <p>Zero-length <code>path</code> segments are ignored. If the joined path string is a
556 <pre><code class="language-js">path.<span class="hljs-title function_">join</span>(<span class="hljs-string">'/foo'</span>, <span class="hljs-string">'bar'</span>, <span class="hljs-string">'baz/asdf'</span>, <span class="hljs-string">'quux'</span>, <span class="hljs-string">'..'</span>);
559 path.<span class="hljs-title function_">join</span>(<span class="hljs-string">'foo'</span>, {}, <span class="hljs-string">'bar'</span>);
560 <span class="hljs-comment">// Throws 'TypeError: Path must be a string. Received {}'</span></code> <button class="copy-button">copy</button></pre>
561 <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>
562 </section><section><h3><code>path.normalize(path)</code><span><a class="mark" href="#pathnormalizepath" id="pathnormalizepath">#</a></span><a aria-hidden="true" class="legacy" id="path_path_normalize_path"></a></h3>
567 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
570 <p>The <code>path.normalize()</code> method normalizes the given <code>path</code>, resolving <code>'..'</code> and
572 <p>When multiple, sequential path segment separation characters are found (e.g.
574 instance of the platform-specific path segment separator (<code>/</code> on POSIX and
576 <p>If the <code>path</code> is a zero-length string, <code>'.'</code> is returned, representing the
579 <pre><code class="language-js">path.<span class="hljs-title function_">normalize</span>(<span class="hljs-string">'/foo/bar//baz/asdf/quux/..'</span>);
582 <pre><code class="language-js">path.<span class="hljs-title function_">normalize</span>(<span class="hljs-string">'C:\\temp\\\\foo\\bar\\..\\'</span>);
584 <p>Since Windows recognizes multiple path separators, both separators will be
586 <pre><code class="language-js">path.<span class="hljs-property">win32</span>.<span class="hljs-title function_">normalize</span>(<span class="hljs-string">'C:////temp\\\\/\\/\\/foo/bar'</span>);
588 <p>A <a href="errors.html#class-typeerror"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>
589 </section><section><h3><code>path.parse(path)</code><span><a class="mark" href="#pathparsepath" id="pathparsepath">#</a></span><a aria-hidden="true" class="legacy" id="path_path_parse_path"></a></h3>
594 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
597 <p>The <code>path.parse()</code> method returns an object whose properties represent
598 significant elements of the <code>path</code>. Trailing directory separators are ignored,
599 see <a href="#pathsep"><code>path.sep</code></a>.</p>
609 <pre><code class="language-js">path.<span class="hljs-title function_">parse</span>(<span class="hljs-string">'/home/user/dir/file.txt'</span>);
624 <pre><code class="language-js">path.<span class="hljs-title function_">parse</span>(<span class="hljs-string">'C:\\path\\dir\\file.txt'</span>);
627 <span class="hljs-comment">// dir: 'C:\\path\\dir',</span>
635 " C:\ path\dir \ file .txt "
638 <p>A <a href="errors.html#class-typeerror"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>
639 </section><section><h3><code>path.posix</code><span><a class="mark" href="#pathposix" id="pathposix">#</a></span><a aria-hidden="true" class="legacy" id="path_path_posix"></a></h3>
645 <td><p>Exposed as <code>require('path/posix')</code>.</p></td></tr>
654 <p>The <code>path.posix</code> property provides access to POSIX specific implementations
655 of the <code>path</code> methods.</p>
656 <p>The API is accessible via <code>require('node:path').posix</code> or <code>require('node:path/posix')</code>.</p>
657 </section><section><h3><code>path.relative(from, to)</code><span><a class="mark" href="#pathrelativefrom-to" id="pathrelativefrom-to">#</a></span><a aria-hidden="true" class="legacy" id="path_path_relative_from_to"></a></h3>
674 <p>The <code>path.relative()</code> method returns the relative path from <code>from</code> to <code>to</code> based
676 path (after calling <code>path.resolve()</code> on each), a zero-length string is returned.</p>
680 <pre><code class="language-js">path.<span class="hljs-title function_">relative</span>(<span class="hljs-string">'/data/orandea/test/aaa'</span>, <span class="hljs-string">'/data/orandea/impl/bbb'</span>);
683 <pre><code class="language-js">path.<span class="hljs-title function_">relative</span>(<span class="hljs-string">'C:\\orandea\\test\\aaa'</span>, <span class="hljs-string">'C:\\orandea\\impl\\bbb'</span>);
686 </section><section><h3><code>path.resolve([...paths])</code><span><a class="mark" href="#pathresolvepaths" id="pathresolvepaths">#</a></span><a aria-hidden="true" class="legacy" id="path_path_resolve_paths"></a></h3>
691 <li><code>...paths</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> A sequence of paths or path segments</li>
694 <p>The <code>path.resolve()</code> method resolves a sequence of paths or path segments into
695 an absolute path.</p>
697 subsequent <code>path</code> prepended until an absolute path is constructed.
698 For instance, given the sequence of path segments: <code>/foo</code>, <code>/bar</code>, <code>baz</code>,
699 calling <code>path.resolve('/foo', '/bar', 'baz')</code> would return <code>/bar/baz</code>
700 because <code>'baz'</code> is not an absolute path but <code>'/bar' + '/' + 'baz'</code> is.</p>
701 <p>If, after processing all given <code>path</code> segments, an absolute path has not yet
703 <p>The resulting path is normalized and trailing slashes are removed unless the
704 path is resolved to the root directory.</p>
705 <p>Zero-length <code>path</code> segments are ignored.</p>
706 <p>If no <code>path</code> segments are passed, <code>path.resolve()</code> will return the absolute path
708 <pre><code class="language-js">path.<span class="hljs-title function_">resolve</span>(<span class="hljs-string">'/foo/bar'</span>, <span class="hljs-string">'./baz'</span>);
711 path.<span class="hljs-title function_">resolve</span>(<span class="hljs-string">'/foo/bar'</span>, <span class="hljs-string">'/tmp/file/'</span>);
714 path.<span class="hljs-title function_">resolve</span>(<span class="hljs-string">'wwwroot'</span>, <span class="hljs-string">'static_files/png/'</span>, <span class="hljs-string">'../gif/image.gif'</span>);
718 </section><section><h3><code>path.sep</code><span><a class="mark" href="#pathsep" id="pathsep">#</a></span><a aria-hidden="true" class="legacy" id="path_path_sep"></a></h3>
725 <p>Provides the platform-specific path segment separator:</p>
731 <pre><code class="language-js"><span class="hljs-string">'foo/bar/baz'</span>.<span class="hljs-title function_">split</span>(path.<span class="hljs-property">sep</span>);
734 <pre><code class="language-js"><span class="hljs-string">'foo\\bar\\baz'</span>.<span class="hljs-title function_">split</span>(path.<span class="hljs-property">sep</span>);
737 as path segment separators; however, the <code>path</code> methods only add backward
739 </section><section><h3><code>path.toNamespacedPath(path)</code><span><a class="mark" href="#pathtonamespacedpathpath" id="pathtonamespacedpathpath">#</a></span><a aria-hidden="true" class="legacy" id="path_path_tonamespacedpath_path"></a></h3>
744 <li><code>path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
747 <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
748 the given <code>path</code>. If <code>path</code> is not a string, <code>path</code> will be returned without
751 method is non-operational and always returns <code>path</code> without modifications.</p>
752 </section><section><h3><code>path.win32</code><span><a class="mark" href="#pathwin32" id="pathwin32">#</a></span><a aria-hidden="true" class="legacy" id="path_path_win32"></a></h3>
758 <td><p>Exposed as <code>require('path/win32')</code>.</p></td></tr>
767 <p>The <code>path.win32</code> property provides access to Windows-specific implementations
768 of the <code>path</code> methods.</p>
769 <p>The API is accessible via <code>require('node:path').win32</code> or <code>require('node:path/win32')</code>.</p></section>