| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cf7e15c commit 7329537
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2028,8 +2028,21 @@ changes: | |||
| 2028 | 2028 | * `err` {Error} | |
| 2029 | 2029 | * `resolvedPath` {string|Buffer} | |
| 2030 | 2030 | ||
| 2031 | - Asynchronous realpath(3). The `callback` gets two arguments `(err, | ||
| 2032 | - resolvedPath)`. May use `process.cwd` to resolve relative paths. | ||
| 2031 | + Asynchronously computes the canonical pathname by resolving `.`, `..` and | ||
| 2032 | + symbolic links. | ||
| 2033 | + | ||
| 2034 | + Note that "canonical" does not mean "unique": hard links and bind mounts can | ||
| 2035 | + expose a file system entity through many pathnames. | ||
| 2036 | + | ||
| 2037 | + This function behaves like realpath(3), with some exceptions: | ||
| 2038 | + | ||
| 2039 | + 1. No case conversion is performed on case-insensitive file systems. | ||
| 2040 | + | ||
| 2041 | + 2. The maximum number of symbolic links is platform-independent and generally | ||
| 2042 | + (much) higher than what the native realpath(3) implementation supports. | ||
| 2043 | + | ||
| 2044 | + The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` | ||
| 2045 | + to resolve relative paths. | ||
| 2033 | 2046 | ||
| 2034 | 2047 | Only paths that can be converted to UTF8 strings are supported. | |
| 2035 | 2048 | ||
@@ -2041,6 +2054,33 @@ the path returned will be passed as a `Buffer` object. | |||
| 2041 | 2054 | *Note*: If `path` resolves to a socket or a pipe, the function will return a | |
| 2042 | 2055 | system dependent name for that object. | |
| 2043 | 2056 | ||
| 2057 | + ## fs.realpath.native(path[, options], callback) | ||
| 2058 | + <!-- YAML | ||
| 2059 | + added: v9.2.0 | ||
| 2060 | + --> | ||
| 2061 | + | ||
| 2062 | + * `path` {string|Buffer|URL} | ||
| 2063 | + * `options` {string|Object} | ||
| 2064 | + * `encoding` {string} **Default:** `'utf8'` | ||
| 2065 | + * `callback` {Function} | ||
| 2066 | + * `err` {Error} | ||
| 2067 | + * `resolvedPath` {string|Buffer} | ||
| 2068 | + | ||
| 2069 | + Asynchronous realpath(3). | ||
| 2070 | + | ||
| 2071 | + The `callback` gets two arguments `(err, resolvedPath)`. | ||
| 2072 | + | ||
| 2073 | + Only paths that can be converted to UTF8 strings are supported. | ||
| 2074 | + | ||
| 2075 | + The optional `options` argument can be a string specifying an encoding, or an | ||
| 2076 | + object with an `encoding` property specifying the character encoding to use for | ||
| 2077 | + the path passed to the callback. If the `encoding` is set to `'buffer'`, | ||
| 2078 | + the path returned will be passed as a `Buffer` object. | ||
| 2079 | + | ||
| 2080 | + *Note*: On Linux, when Node.js is linked against musl libc, the procfs file | ||
| 2081 | + system must be mounted on `/proc` in order for this function to work. Glibc | ||
| 2082 | + does not have this restriction. | ||
| 2083 | + | ||
| 2044 | 2084 | ## fs.realpathSync(path[, options]) | |
| 2045 | 2085 | <!-- YAML | |
| 2046 | 2086 | added: v0.1.31 | |
@@ -2065,9 +2105,18 @@ changes: | |||
| 2065 | 2105 | * `options` {string|Object} | |
| 2066 | 2106 | * `encoding` {string} **Default:** `'utf8'` | |
| 2067 | 2107 | ||
| 2068 | - Synchronous realpath(3). Returns the resolved path. | ||
| 2108 | + Synchronously computes the canonical pathname by resolving `.`, `..` and | ||
| 2109 | + symbolic links. | ||
| 2069 | 2110 | ||
| 2070 | - Only paths that can be converted to UTF8 strings are supported. | ||
| 2111 | + Note that "canonical" does not mean "unique": hard links and bind mounts can | ||
| 2112 | + expose a file system entity through many pathnames. | ||
| 2113 | + | ||
| 2114 | + This function behaves like realpath(3), with some exceptions: | ||
| 2115 | + | ||
| 2116 | + 1. No case conversion is performed on case-insensitive file systems. | ||
| 2117 | + | ||
| 2118 | + 2. The maximum number of symbolic links is platform-independent and generally | ||
| 2119 | + (much) higher than what the native realpath(3) implementation supports. | ||
| 2071 | 2120 | ||
| 2072 | 2121 | The optional `options` argument can be a string specifying an encoding, or an | |
| 2073 | 2122 | object with an `encoding` property specifying the character encoding to use for | |
@@ -2077,6 +2126,28 @@ will be passed as a `Buffer` object. | |||
| 2077 | 2126 | *Note*: If `path` resolves to a socket or a pipe, the function will return a | |
| 2078 | 2127 | system dependent name for that object. | |
| 2079 | 2128 | ||
| 2129 | + ## fs.realpathSync.native(path[, options]) | ||
| 2130 | + <!-- YAML | ||
| 2131 | + added: v9.2.0 | ||
| 2132 | + --> | ||
| 2133 | + | ||
| 2134 | + * `path` {string|Buffer|URL} | ||
| 2135 | + * `options` {string|Object} | ||
| 2136 | + * `encoding` {string} **Default:** `'utf8'` | ||
| 2137 | + | ||
| 2138 | + Synchronous realpath(3). | ||
| 2139 | + | ||
| 2140 | + Only paths that can be converted to UTF8 strings are supported. | ||
| 2141 | + | ||
| 2142 | + The optional `options` argument can be a string specifying an encoding, or an | ||
| 2143 | + object with an `encoding` property specifying the character encoding to use for | ||
| 2144 | + the path passed to the callback. If the `encoding` is set to `'buffer'`, | ||
| 2145 | + the path returned will be passed as a `Buffer` object. | ||
| 2146 | + | ||
| 2147 | + *Note*: On Linux, when Node.js is linked against musl libc, the procfs file | ||
| 2148 | + system must be mounted on `/proc` in order for this function to work. Glibc | ||
| 2149 | + does not have this restriction. | ||
| 2150 | + | ||
| 2080 | 2151 | ## fs.rename(oldPath, newPath, callback) | |
| 2081 | 2152 | <!-- YAML | |
| 2082 | 2153 | added: v0.0.2 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments