Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.191.120.131
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
nodejs-docs-14.18.3 /
html /
api /
Delete
Unzip
Name
Size
Permission
Date
Action
assets
[ DIR ]
drwxr-xr-x
2022-01-26 16:43
addons.html
97.08
KB
-rw-r--r--
2022-01-10 13:06
addons.json
48.6
KB
-rw-r--r--
2022-01-10 13:06
addons.md
39.44
KB
-rw-r--r--
2022-01-10 13:06
all.html
5.06
MB
-rw-r--r--
2022-01-10 13:06
all.json
4.78
MB
-rw-r--r--
2022-01-10 13:06
assert.html
118.84
KB
-rw-r--r--
2022-01-10 13:06
assert.json
83.37
KB
-rw-r--r--
2022-01-10 13:06
assert.md
47.93
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.html
94.53
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.json
64.9
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.md
38.62
KB
-rw-r--r--
2022-01-10 13:06
buffer.html
289.36
KB
-rw-r--r--
2022-01-10 13:06
buffer.json
227.52
KB
-rw-r--r--
2022-01-10 13:06
buffer.md
109.83
KB
-rw-r--r--
2022-01-10 13:06
child_process.html
156.96
KB
-rw-r--r--
2022-01-10 13:06
child_process.json
140.03
KB
-rw-r--r--
2022-01-10 13:06
child_process.md
69.69
KB
-rw-r--r--
2022-01-10 13:06
cli.html
99.52
KB
-rw-r--r--
2022-01-10 13:06
cli.json
97.49
KB
-rw-r--r--
2022-01-10 13:06
cli.md
47.37
KB
-rw-r--r--
2022-01-10 13:06
cluster.html
65.92
KB
-rw-r--r--
2022-01-10 13:06
cluster.json
45.84
KB
-rw-r--r--
2022-01-10 13:06
cluster.md
24.83
KB
-rw-r--r--
2022-01-10 13:06
console.html
50.57
KB
-rw-r--r--
2022-01-10 13:06
console.json
40.04
KB
-rw-r--r--
2022-01-10 13:06
console.md
16.55
KB
-rw-r--r--
2022-01-10 13:06
crypto.html
297.2
KB
-rw-r--r--
2022-01-10 13:06
crypto.json
261.36
KB
-rw-r--r--
2022-01-10 13:06
crypto.md
124.37
KB
-rw-r--r--
2022-01-10 13:06
debugger.html
21.62
KB
-rw-r--r--
2022-01-10 13:06
debugger.json
9.75
KB
-rw-r--r--
2022-01-10 13:06
debugger.md
6.43
KB
-rw-r--r--
2022-01-10 13:06
deprecations.html
142.64
KB
-rw-r--r--
2022-01-10 13:06
deprecations.json
164.68
KB
-rw-r--r--
2022-01-10 13:06
deprecations.md
81.32
KB
-rw-r--r--
2022-01-10 13:06
dgram.html
67.09
KB
-rw-r--r--
2022-01-10 13:06
dgram.json
57.33
KB
-rw-r--r--
2022-01-10 13:06
dgram.md
27.81
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.html
21.13
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.json
10.8
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.md
5.24
KB
-rw-r--r--
2022-01-10 13:06
dns.html
109.72
KB
-rw-r--r--
2022-01-10 13:06
dns.json
98.84
KB
-rw-r--r--
2022-01-10 13:06
dns.md
44.29
KB
-rw-r--r--
2022-01-10 13:06
documentation.html
18.4
KB
-rw-r--r--
2022-01-10 13:06
documentation.json
8.83
KB
-rw-r--r--
2022-01-10 13:06
documentation.md
4.05
KB
-rw-r--r--
2022-01-10 13:06
domain.html
41.38
KB
-rw-r--r--
2022-01-10 13:06
domain.json
22.06
KB
-rw-r--r--
2022-01-10 13:06
domain.md
15.2
KB
-rw-r--r--
2022-01-10 13:06
embedding.html
24.65
KB
-rw-r--r--
2022-01-10 13:06
embedding.json
10.05
KB
-rw-r--r--
2022-01-10 13:06
embedding.md
8.67
KB
-rw-r--r--
2022-01-10 13:06
errors.html
189.1
KB
-rw-r--r--
2022-01-10 13:06
errors.json
194.73
KB
-rw-r--r--
2022-01-10 13:06
errors.md
82.71
KB
-rw-r--r--
2022-01-10 13:06
esm.html
97.97
KB
-rw-r--r--
2022-01-10 13:06
esm.json
78.48
KB
-rw-r--r--
2022-01-10 13:06
esm.md
48.2
KB
-rw-r--r--
2022-01-10 13:06
events.html
129.56
KB
-rw-r--r--
2022-01-10 13:06
events.json
94.12
KB
-rw-r--r--
2022-01-10 13:06
events.md
43.71
KB
-rw-r--r--
2022-01-10 13:06
fs.html
503.09
KB
-rw-r--r--
2022-01-10 13:06
fs.json
500.22
KB
-rw-r--r--
2022-01-10 13:06
fs.md
210.32
KB
-rw-r--r--
2022-01-10 13:06
globals.html
29.55
KB
-rw-r--r--
2022-01-10 13:06
globals.json
31.16
KB
-rw-r--r--
2022-01-10 13:06
globals.md
8.21
KB
-rw-r--r--
2022-01-10 13:06
http.html
213.14
KB
-rw-r--r--
2022-01-10 13:06
http.json
214.96
KB
-rw-r--r--
2022-01-10 13:06
http.md
91.28
KB
-rw-r--r--
2022-01-10 13:06
http2.html
274.7
KB
-rw-r--r--
2022-01-10 13:06
http2.json
274.23
KB
-rw-r--r--
2022-01-10 13:06
http2.md
123.62
KB
-rw-r--r--
2022-01-10 13:06
https.html
44.54
KB
-rw-r--r--
2022-01-10 13:06
https.json
36.55
KB
-rw-r--r--
2022-01-10 13:06
https.md
14.58
KB
-rw-r--r--
2022-01-10 13:06
index.html
12.21
KB
-rw-r--r--
2022-01-10 13:06
index.json
54
B
-rw-r--r--
2022-01-10 13:06
index.md
1.73
KB
-rw-r--r--
2022-01-10 13:06
inspector.html
25.57
KB
-rw-r--r--
2022-01-10 13:06
inspector.json
13.43
KB
-rw-r--r--
2022-01-10 13:06
inspector.md
6.66
KB
-rw-r--r--
2022-01-10 13:06
intl.html
25.1
KB
-rw-r--r--
2022-01-10 13:06
intl.json
14.5
KB
-rw-r--r--
2022-01-10 13:06
intl.md
10.46
KB
-rw-r--r--
2022-01-10 13:06
module.html
23.9
KB
-rw-r--r--
2022-01-10 13:06
module.json
13.29
KB
-rw-r--r--
2022-01-10 13:06
module.md
5.2
KB
-rw-r--r--
2022-01-10 13:06
modules.html
67.19
KB
-rw-r--r--
2022-01-10 13:06
modules.json
48.92
KB
-rw-r--r--
2022-01-10 13:06
modules.md
30.83
KB
-rw-r--r--
2022-01-10 13:06
n-api.html
336.63
KB
-rw-r--r--
2022-01-10 13:06
n-api.json
330.37
KB
-rw-r--r--
2022-01-10 13:06
n-api.md
206.51
KB
-rw-r--r--
2022-01-10 13:06
net.html
111.64
KB
-rw-r--r--
2022-01-10 13:06
net.json
108.87
KB
-rw-r--r--
2022-01-10 13:06
net.md
44.19
KB
-rw-r--r--
2022-01-10 13:06
os.html
60.56
KB
-rw-r--r--
2022-01-10 13:06
os.json
50.72
KB
-rw-r--r--
2022-01-10 13:06
os.md
33.98
KB
-rw-r--r--
2022-01-10 13:06
packages.html
80.39
KB
-rw-r--r--
2022-01-10 13:06
packages.json
59.35
KB
-rw-r--r--
2022-01-10 13:06
packages.md
39.1
KB
-rw-r--r--
2022-01-10 13:06
path.html
43.66
KB
-rw-r--r--
2022-01-10 13:06
path.json
27.96
KB
-rw-r--r--
2022-01-10 13:06
path.md
14.46
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.html
71.71
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.json
49.24
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.md
23.17
KB
-rw-r--r--
2022-01-10 13:06
policy.html
35.98
KB
-rw-r--r--
2022-01-10 13:06
policy.json
18.38
KB
-rw-r--r--
2022-01-10 13:06
policy.md
13.9
KB
-rw-r--r--
2022-01-10 13:06
process.html
192.69
KB
-rw-r--r--
2022-01-10 13:06
process.json
150.9
KB
-rw-r--r--
2022-01-10 13:06
process.md
86.44
KB
-rw-r--r--
2022-01-10 13:06
punycode.html
19.88
KB
-rw-r--r--
2022-01-10 13:06
punycode.json
8.79
KB
-rw-r--r--
2022-01-10 13:06
punycode.md
4.17
KB
-rw-r--r--
2022-01-10 13:06
querystring.html
22.01
KB
-rw-r--r--
2022-01-10 13:06
querystring.json
12.74
KB
-rw-r--r--
2022-01-10 13:06
querystring.md
5.48
KB
-rw-r--r--
2022-01-10 13:06
readline.html
69.79
KB
-rw-r--r--
2022-01-10 13:06
readline.json
55.74
KB
-rw-r--r--
2022-01-10 13:06
readline.md
28.04
KB
-rw-r--r--
2022-01-10 13:06
repl.html
58.19
KB
-rw-r--r--
2022-01-10 13:06
repl.json
44.5
KB
-rw-r--r--
2022-01-10 13:06
repl.md
23.61
KB
-rw-r--r--
2022-01-10 13:06
report.html
71.4
KB
-rw-r--r--
2022-01-10 13:06
report.json
21.23
KB
-rw-r--r--
2022-01-10 13:06
report.md
17.92
KB
-rw-r--r--
2022-01-10 13:06
stream.html
226.43
KB
-rw-r--r--
2022-01-10 13:06
stream.json
223.31
KB
-rw-r--r--
2022-01-10 13:06
stream.md
100.94
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.html
17.5
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.json
5.8
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.md
2.94
KB
-rw-r--r--
2022-01-10 13:06
synopsis.html
13.93
KB
-rw-r--r--
2022-01-10 13:06
synopsis.json
2.97
KB
-rw-r--r--
2022-01-10 13:06
synopsis.md
2.13
KB
-rw-r--r--
2022-01-10 13:06
timers.html
32.99
KB
-rw-r--r--
2022-01-10 13:06
timers.json
23.92
KB
-rw-r--r--
2022-01-10 13:06
timers.md
10.55
KB
-rw-r--r--
2022-01-10 13:06
tls.html
152.2
KB
-rw-r--r--
2022-01-10 13:06
tls.json
161.77
KB
-rw-r--r--
2022-01-10 13:06
tls.md
81.06
KB
-rw-r--r--
2022-01-10 13:06
tracing.html
22.43
KB
-rw-r--r--
2022-01-10 13:06
tracing.json
12.14
KB
-rw-r--r--
2022-01-10 13:06
tracing.md
6.59
KB
-rw-r--r--
2022-01-10 13:06
tty.html
29.16
KB
-rw-r--r--
2022-01-10 13:06
tty.json
22.31
KB
-rw-r--r--
2022-01-10 13:06
tty.md
8.78
KB
-rw-r--r--
2022-01-10 13:06
url.html
122.38
KB
-rw-r--r--
2022-01-10 13:06
url.json
88.21
KB
-rw-r--r--
2022-01-10 13:06
url.md
49.32
KB
-rw-r--r--
2022-01-10 13:06
util.html
199.52
KB
-rw-r--r--
2022-01-10 13:06
util.json
171.18
KB
-rw-r--r--
2022-01-10 13:06
util.md
71.47
KB
-rw-r--r--
2022-01-10 13:06
v8.html
51.61
KB
-rw-r--r--
2022-01-10 13:06
v8.json
39.5
KB
-rw-r--r--
2022-01-10 13:06
v8.md
16.55
KB
-rw-r--r--
2022-01-10 13:06
vm.html
123.51
KB
-rw-r--r--
2022-01-10 13:06
vm.json
113.19
KB
-rw-r--r--
2022-01-10 13:06
vm.md
55.37
KB
-rw-r--r--
2022-01-10 13:06
wasi.html
21.16
KB
-rw-r--r--
2022-01-10 13:06
wasi.json
11.72
KB
-rw-r--r--
2022-01-10 13:06
wasi.md
6.27
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.html
90.29
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.json
69.84
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.md
39
KB
-rw-r--r--
2022-01-10 13:06
zlib.html
95.09
KB
-rw-r--r--
2022-01-10 13:06
zlib.json
100.2
KB
-rw-r--r--
2022-01-10 13:06
zlib.md
35.03
KB
-rw-r--r--
2022-01-10 13:06
Save
Rename
# Path <!--introduced_in=v0.10.0--> > Stability: 2 - Stable <!-- source_link=lib/path.js --> The `path` module provides utilities for working with file and directory paths. It can be accessed using: ```js const path = require('path'); ``` ## Windows vs. POSIX The default operation of the `path` module varies based on the operating system on which a Node.js application is running. Specifically, when running on a Windows operating system, the `path` module will assume that Windows-style paths are being used. So using `path.basename()` might yield different results on POSIX and Windows: On POSIX: ```js path.basename('C:\\temp\\myfile.html'); // Returns: 'C:\\temp\\myfile.html' ``` On Windows: ```js path.basename('C:\\temp\\myfile.html'); // Returns: 'myfile.html' ``` To achieve consistent results when working with Windows file paths on any operating system, use [`path.win32`][]: On POSIX and Windows: ```js path.win32.basename('C:\\temp\\myfile.html'); // Returns: 'myfile.html' ``` To achieve consistent results when working with POSIX file paths on any operating system, use [`path.posix`][]: On POSIX and Windows: ```js path.posix.basename('/tmp/myfile.html'); // Returns: 'myfile.html' ``` On Windows Node.js follows the concept of per-drive working directory. This behavior can be observed when using a drive path without a backslash. For example, `path.resolve('C:\\')` can potentially return a different result than `path.resolve('C:')`. For more information, see [this MSDN page][MSDN-Rel-Path]. ## `path.basename(path[, ext])` <!-- YAML 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. --> * `path` {string} * `ext` {string} An optional file extension * Returns: {string} The `path.basename()` method returns the last portion of a `path`, similar to the Unix `basename` command. Trailing directory separators are ignored, see [`path.sep`][]. ```js path.basename('/foo/bar/baz/asdf/quux.html'); // Returns: 'quux.html' path.basename('/foo/bar/baz/asdf/quux.html', '.html'); // Returns: 'quux' ``` Although Windows usually treats file names, including file extensions, in a case-insensitive manner, this function does not. For example, `C:\\foo.html` and `C:\\foo.HTML` refer to the same file, but `basename` treats the extension as a case-sensitive string: ```js path.win32.basename('C:\\foo.html', '.html'); // Returns: 'foo' path.win32.basename('C:\\foo.HTML', '.html'); // Returns: 'foo.HTML' ``` A [`TypeError`][] is thrown if `path` is not a string or if `ext` is given and is not a string. ## `path.delimiter` <!-- YAML added: v0.9.3 --> * {string} Provides the platform-specific path delimiter: * `;` for Windows * `:` for POSIX For example, on POSIX: ```js console.log(process.env.PATH); // Prints: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' process.env.PATH.split(path.delimiter); // Returns: ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] ``` On Windows: ```js console.log(process.env.PATH); // Prints: 'C:\Windows\system32;C:\Windows;C:\Program Files\node\' process.env.PATH.split(path.delimiter); // Returns ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\node\\'] ``` ## `path.dirname(path)` <!-- YAML 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. --> * `path` {string} * Returns: {string} The `path.dirname()` method returns the directory name of a `path`, similar to the Unix `dirname` command. Trailing directory separators are ignored, see [`path.sep`][]. ```js path.dirname('/foo/bar/baz/asdf/quux'); // Returns: '/foo/bar/baz/asdf' ``` A [`TypeError`][] is thrown if `path` is not a string. ## `path.extname(path)` <!-- YAML 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. --> * `path` {string} * Returns: {string} The `path.extname()` method returns the extension of the `path`, from the last occurrence of the `.` (period) character to end of string in the last portion of the `path`. If there is no `.` in the last portion of the `path`, or if there are no `.` characters other than the first character of the basename of `path` (see `path.basename()`) , an empty string is returned. ```js path.extname('index.html'); // Returns: '.html' path.extname('index.coffee.md'); // Returns: '.md' path.extname('index.'); // Returns: '.' path.extname('index'); // Returns: '' path.extname('.index'); // Returns: '' path.extname('.index.md'); // Returns: '.md' ``` A [`TypeError`][] is thrown if `path` is not a string. ## `path.format(pathObject)` <!-- YAML added: v0.11.15 --> * `pathObject` {Object} Any JavaScript object having the following properties: * `dir` {string} * `root` {string} * `base` {string} * `name` {string} * `ext` {string} * Returns: {string} The `path.format()` method returns a path string from an object. This is the opposite of [`path.parse()`][]. When providing properties to the `pathObject` remember that there are combinations where one property has priority over another: * `pathObject.root` is ignored if `pathObject.dir` is provided * `pathObject.ext` and `pathObject.name` are ignored if `pathObject.base` exists For example, on POSIX: ```js // If `dir`, `root` and `base` are provided, // `${dir}${path.sep}${base}` // will be returned. `root` is ignored. path.format({ root: '/ignored', dir: '/home/user/dir', base: 'file.txt' }); // Returns: '/home/user/dir/file.txt' // `root` will be used if `dir` is not specified. // If only `root` is provided or `dir` is equal to `root` then the // platform separator will not be included. `ext` will be ignored. path.format({ root: '/', base: 'file.txt', ext: 'ignored' }); // Returns: '/file.txt' // `name` + `ext` will be used if `base` is not specified. path.format({ root: '/', name: 'file', ext: '.txt' }); // Returns: '/file.txt' ``` On Windows: ```js path.format({ dir: 'C:\\path\\dir', base: 'file.txt' }); // Returns: 'C:\\path\\dir\\file.txt' ``` ## `path.isAbsolute(path)` <!-- YAML added: v0.11.2 --> * `path` {string} * Returns: {boolean} The `path.isAbsolute()` method determines if `path` is an absolute path. If the given `path` is a zero-length string, `false` will be returned. For example, on POSIX: ```js path.isAbsolute('/foo/bar'); // true path.isAbsolute('/baz/..'); // true path.isAbsolute('qux/'); // false path.isAbsolute('.'); // false ``` On Windows: ```js path.isAbsolute('//server'); // true path.isAbsolute('\\\\server'); // true path.isAbsolute('C:/foo/..'); // true path.isAbsolute('C:\\foo\\..'); // true path.isAbsolute('bar\\baz'); // false path.isAbsolute('bar/baz'); // false path.isAbsolute('.'); // false ``` A [`TypeError`][] is thrown if `path` is not a string. ## `path.join([...paths])` <!-- YAML added: v0.1.16 --> * `...paths` {string} A sequence of path segments * Returns: {string} The `path.join()` method joins all given `path` segments together using the platform-specific separator as a delimiter, then normalizes the resulting path. Zero-length `path` segments are ignored. If the joined path string is a zero-length string then `'.'` will be returned, representing the current working directory. ```js path.join('/foo', 'bar', 'baz/asdf', 'quux', '..'); // Returns: '/foo/bar/baz/asdf' path.join('foo', {}, 'bar'); // Throws 'TypeError: Path must be a string. Received {}' ``` A [`TypeError`][] is thrown if any of the path segments is not a string. ## `path.normalize(path)` <!-- YAML added: v0.1.23 --> * `path` {string} * Returns: {string} The `path.normalize()` method normalizes the given `path`, resolving `'..'` and `'.'` segments. When multiple, sequential path segment separation characters are found (e.g. `/` on POSIX and either `\` or `/` on Windows), they are replaced by a single instance of the platform-specific path segment separator (`/` on POSIX and `\` on Windows). Trailing separators are preserved. If the `path` is a zero-length string, `'.'` is returned, representing the current working directory. For example, on POSIX: ```js path.normalize('/foo/bar//baz/asdf/quux/..'); // Returns: '/foo/bar/baz/asdf' ``` On Windows: ```js path.normalize('C:\\temp\\\\foo\\bar\\..\\'); // Returns: 'C:\\temp\\foo\\' ``` Since Windows recognizes multiple path separators, both separators will be replaced by instances of the Windows preferred separator (`\`): ```js path.win32.normalize('C:////temp\\\\/\\/\\/foo/bar'); // Returns: 'C:\\temp\\foo\\bar' ``` A [`TypeError`][] is thrown if `path` is not a string. ## `path.parse(path)` <!-- YAML added: v0.11.15 --> * `path` {string} * Returns: {Object} The `path.parse()` method returns an object whose properties represent significant elements of the `path`. Trailing directory separators are ignored, see [`path.sep`][]. The returned object will have the following properties: * `dir` {string} * `root` {string} * `base` {string} * `name` {string} * `ext` {string} For example, on POSIX: ```js path.parse('/home/user/dir/file.txt'); // Returns: // { root: '/', // dir: '/home/user/dir', // base: 'file.txt', // ext: '.txt', // name: 'file' } ``` ```text ┌─────────────────────┬────────────┐ │ dir │ base │ ├──────┬ ├──────┬─────┤ │ root │ │ name │ ext │ " / home/user/dir / file .txt " └──────┴──────────────┴──────┴─────┘ (All spaces in the "" line should be ignored. They are purely for formatting.) ``` On Windows: ```js path.parse('C:\\path\\dir\\file.txt'); // Returns: // { root: 'C:\\', // dir: 'C:\\path\\dir', // base: 'file.txt', // ext: '.txt', // name: 'file' } ``` ```text ┌─────────────────────┬────────────┐ │ dir │ base │ ├──────┬ ├──────┬─────┤ │ root │ │ name │ ext │ " C:\ path\dir \ file .txt " └──────┴──────────────┴──────┴─────┘ (All spaces in the "" line should be ignored. They are purely for formatting.) ``` A [`TypeError`][] is thrown if `path` is not a string. ## `path.posix` <!-- YAML added: v0.11.15 --> * {Object} The `path.posix` property provides access to POSIX specific implementations of the `path` methods. ## `path.relative(from, to)` <!-- YAML 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. --> * `from` {string} * `to` {string} * Returns: {string} The `path.relative()` method returns the relative path from `from` to `to` based on the current working directory. If `from` and `to` each resolve to the same path (after calling `path.resolve()` on each), a zero-length string is returned. If a zero-length string is passed as `from` or `to`, the current working directory will be used instead of the zero-length strings. For example, on POSIX: ```js path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb'); // Returns: '../../impl/bbb' ``` On Windows: ```js path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'); // Returns: '..\\..\\impl\\bbb' ``` A [`TypeError`][] is thrown if either `from` or `to` is not a string. ## `path.resolve([...paths])` <!-- YAML added: v0.3.4 --> * `...paths` {string} A sequence of paths or path segments * Returns: {string} The `path.resolve()` method resolves a sequence of paths or path segments into an absolute path. The given sequence of paths is processed from right to left, with each subsequent `path` prepended until an absolute path is constructed. For instance, given the sequence of path segments: `/foo`, `/bar`, `baz`, calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz` because `'baz'` is not an absolute path but `'/bar' + '/' + 'baz'` is. If, after processing all given `path` segments, an absolute path has not yet been generated, the current working directory is used. The resulting path is normalized and trailing slashes are removed unless the path is resolved to the root directory. Zero-length `path` segments are ignored. If no `path` segments are passed, `path.resolve()` will return the absolute path of the current working directory. ```js path.resolve('/foo/bar', './baz'); // Returns: '/foo/bar/baz' path.resolve('/foo/bar', '/tmp/file/'); // Returns: '/tmp/file' path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif'); // If the current working directory is /home/myself/node, // this returns '/home/myself/node/wwwroot/static_files/gif/image.gif' ``` A [`TypeError`][] is thrown if any of the arguments is not a string. ## `path.sep` <!-- YAML added: v0.7.9 --> * {string} Provides the platform-specific path segment separator: * `\` on Windows * `/` on POSIX For example, on POSIX: ```js 'foo/bar/baz'.split(path.sep); // Returns: ['foo', 'bar', 'baz'] ``` On Windows: ```js 'foo\\bar\\baz'.split(path.sep); // Returns: ['foo', 'bar', 'baz'] ``` On Windows, both the forward slash (`/`) and backward slash (`\`) are accepted as path segment separators; however, the `path` methods only add backward slashes (`\`). ## `path.toNamespacedPath(path)` <!-- YAML added: v9.0.0 --> * `path` {string} * Returns: {string} On Windows systems only, returns an equivalent [namespace-prefixed path][] for the given `path`. If `path` is not a string, `path` will be returned without modifications. This method is meaningful only on Windows systems. On POSIX systems, the method is non-operational and always returns `path` without modifications. ## `path.win32` <!-- YAML added: v0.11.15 --> * {Object} The `path.win32` property provides access to Windows-specific implementations of the `path` methods. [MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths [`TypeError`]: errors.md#errors_class_typeerror [`path.parse()`]: #path_path_parse_path [`path.posix`]: #path_path_posix [`path.sep`]: #path_path_sep [`path.win32`]: #path_path_win32 [namespace-prefixed path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#namespaces