diff --git a/doc/api/fs.md b/doc/api/fs.md index 8bc585d3a729..15f3167c7d55 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -574,6 +574,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `mode` {integer} **Default:** `fs.constants.F_OK` @@ -640,6 +643,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/3163 description: The `file` parameter can be a file descriptor now. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `file` {string|Buffer|number} filename or file descriptor * `data` {string|Buffer} @@ -719,6 +725,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `uid` {integer} @@ -747,6 +756,9 @@ to the completion callback. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} @@ -805,6 +817,9 @@ fs.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL, callback); +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `src` {string|Buffer|URL} source filename to copy * `dest` {string|Buffer|URL} destination filename of the copy operation @@ -1128,6 +1143,9 @@ are given to the completion callback. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `mode` {integer} @@ -1157,6 +1175,9 @@ to the completion callback. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `uid` {integer} @@ -1185,6 +1206,9 @@ given to the completion callback. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} @@ -1213,6 +1237,9 @@ except that the file to be stat-ed is specified by the file descriptor `fd`. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} @@ -1239,6 +1266,9 @@ to the completion callback. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} @@ -1307,6 +1337,9 @@ The last three bytes are null bytes ('\0'), to compensate the over-truncation. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `len` {integer} **Default:** `0` @@ -1348,6 +1381,9 @@ changes: description: Numeric strings, `NaN` and `Infinity` are now allowed time specifiers. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `atime` {integer} @@ -1379,6 +1415,9 @@ Only available on macOS. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer} * `mode` {integer} @@ -1448,6 +1487,9 @@ changes: `URL` objects using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `existingPath` {string|Buffer|URL} * `newPath` {string|Buffer|URL} @@ -1487,6 +1529,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} @@ -1523,6 +1568,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `mode` {integer} **Default:** `0o777` @@ -1605,6 +1653,9 @@ fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => { +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `prefix` {string} * `options` {string|Object} @@ -1724,6 +1775,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `flags` {string|number} @@ -1814,6 +1868,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `options` {string|Object} @@ -1914,6 +1971,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/3163 description: The `path` parameter can be a file descriptor now. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL|integer} filename or file descriptor * `options` {Object|string} @@ -1975,6 +2035,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `options` {string|Object} @@ -1995,6 +2058,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/4518 description: The `length` parameter can now be `0`. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `buffer` {string|Buffer|Uint8Array} @@ -2107,6 +2173,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/3594 description: The `cache` parameter was removed. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `options` {string|Object} @@ -2188,6 +2257,9 @@ changes: objects using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `oldPath` {string|Buffer|URL} * `newPath` {string|Buffer|URL} @@ -2227,6 +2299,9 @@ changes: description: The `path` parameters can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} @@ -2276,6 +2351,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} @@ -2323,6 +2401,9 @@ changes: using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `target` {string|Buffer|URL} * `path` {string|Buffer|URL} @@ -2356,6 +2437,9 @@ being thrown in the future. +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer} * `len` {integer} **Default:** `0` @@ -2396,6 +2480,9 @@ changes: description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} @@ -2475,6 +2562,9 @@ changes: description: Numeric strings, `NaN` and `Infinity` are now allowed time specifiers. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `path` {string|Buffer|URL} * `atime` {integer} @@ -2820,6 +2910,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/3163 description: The `file` parameter can be a file descriptor now. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `file` {string|Buffer|integer} filename or file descriptor * `data` {string|Buffer|Uint8Array} @@ -2841,6 +2934,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/7856 description: The `offset` and `length` parameters are optional now. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `buffer` {Buffer|Uint8Array} @@ -2856,6 +2952,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/7856 description: The `position` parameter is optional now. --> +Note that this is a blocking call. Avoid this method in an asynchronous +environment. See [Overview of Blocking vs Non-Blocking][] +for more information. * `fd` {integer} * `string` {string} @@ -3137,3 +3236,4 @@ The following constants are meant for use with the [`fs.Stats`][] object's [inode]: https://en.wikipedia.org/wiki/Inode [Naming Files, Paths, and Namespaces]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx [MSDN-Using-Streams]: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540537.aspx +[Overview of Blocking vs Non-Blocking]: https://nodejs.org/en/docs/guides/blocking-vs-non-blocking/