diff options
Diffstat (limited to 'doc/api/fs.md')
-rw-r--r-- | doc/api/fs.md | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index a80a5efcb4..d585164faf 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -322,7 +322,7 @@ fs.watch('./tmp', { encoding: 'buffer' }, (eventType, filename) => { ### Event: 'close' <!-- YAML -added: REPLACEME +added: v10.0.0 --> Emitted when the watcher stops watching for changes. @@ -896,7 +896,7 @@ try { <!-- YAML added: v0.6.7 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1016,7 +1016,7 @@ try { <!-- YAML added: v0.1.30 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1103,7 +1103,7 @@ See also: chmod(2) <!-- YAML added: v0.1.97 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1151,7 +1151,7 @@ See also: chown(2) <!-- YAML added: v0.0.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1532,7 +1532,7 @@ a callback.) <!-- YAML added: v0.4.7 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1564,7 +1564,7 @@ Synchronous fchmod(2). Returns `undefined`. <!-- YAML added: v0.4.7 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1598,7 +1598,7 @@ Synchronous fchown(2). Returns `undefined`. <!-- YAML added: v0.1.96 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1628,7 +1628,7 @@ Synchronous fdatasync(2). Returns `undefined`. <!-- YAML added: v0.1.95 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1661,7 +1661,7 @@ Synchronous fstat(2). <!-- YAML added: v0.1.96 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1691,7 +1691,7 @@ Synchronous fsync(2). Returns `undefined`. <!-- YAML added: v0.8.6 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1764,7 +1764,7 @@ Synchronous ftruncate(2). Returns `undefined`. <!-- YAML added: v0.4.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1810,7 +1810,7 @@ Synchronous version of [`fs.futimes()`][]. Returns `undefined`. <!-- YAML deprecated: v0.4.7 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1844,7 +1844,7 @@ Synchronous lchmod(2). Returns `undefined`. <!-- YAML deprecated: v0.4.7 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1878,7 +1878,7 @@ Synchronous lchown(2). Returns `undefined`. <!-- YAML added: v0.1.31 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1921,7 +1921,7 @@ Synchronous link(2). Returns `undefined`. <!-- YAML added: v0.1.30 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -1964,7 +1964,7 @@ Synchronous lstat(2). <!-- YAML added: v0.1.8 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2010,7 +2010,7 @@ See also: mkdir(2) <!-- YAML added: v5.10.0 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2195,7 +2195,7 @@ a Promise for an object with `bytesRead` and `buffer` properties. <!-- YAML added: v0.1.8 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2254,7 +2254,7 @@ the filenames returned will be passed as `Buffer` objects. <!-- YAML added: v0.1.29 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2368,7 +2368,7 @@ fs.readFileSync('<directory>'); // => null, <data> <!-- YAML added: v0.1.31 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2441,7 +2441,7 @@ Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. <!-- YAML added: v0.1.31 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2598,7 +2598,7 @@ this restriction. <!-- YAML added: v0.0.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2652,7 +2652,7 @@ Synchronous rename(2). Returns `undefined`. <!-- YAML added: v0.0.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2697,7 +2697,7 @@ on Windows and an `ENOTDIR` error on POSIX. <!-- YAML added: v0.0.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2797,7 +2797,7 @@ Synchronous symlink(2). Returns `undefined`. <!-- YAML added: v0.8.6 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2837,7 +2837,7 @@ in the future. <!-- YAML added: v0.0.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -2909,7 +2909,7 @@ and `fs.unwatchFile()` when possible. <!-- YAML added: v0.4.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -3146,7 +3146,7 @@ This happens when: <!-- YAML added: v0.0.2 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -3199,7 +3199,7 @@ the end of the file. <!-- YAML added: v0.11.5 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -3250,7 +3250,7 @@ the end of the file. <!-- YAML added: v0.1.29 changes: - - version: REPLACEME + - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/12562 description: The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime. @@ -3371,7 +3371,7 @@ API is accessible via `require('fs/promises')`. ### class: FileHandle <!-- YAML -added: REPLACEME +added: v10.0.0 --> A `FileHandle` object is a wrapper for a numeric file descriptor. @@ -3391,7 +3391,7 @@ unclosed file descriptors after a `Promise` is resolved or rejected. #### filehandle.appendFile(data, options) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `data` {string|Buffer} * `options` {Object|string} @@ -3410,7 +3410,7 @@ The `FileHandle` must have been opened for appending. #### filehandle.chmod(mode) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `mode` {integer} * Returns: {Promise} @@ -3420,7 +3420,7 @@ arguments upon success. #### filehandle.chown(uid, gid) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `uid` {integer} * `gid` {integer} @@ -3431,7 +3431,7 @@ upon success. #### filehandle.close() <!-- YAML -added: REPLACEME +added: v10.0.0 --> * Returns: {Promise} A `Promise` that will be resolved once the underlying @@ -3454,7 +3454,7 @@ async function openAndClose() { #### filehandle.datasync() <!-- YAML -added: REPLACEME +added: v10.0.0 --> * Returns: {Promise} @@ -3463,14 +3463,14 @@ success. #### filehandle.fd <!-- YAML -added: REPLACEME +added: v10.0.0 --> * {number} The numeric file descriptor managed by the `FileHandle` object. #### filehandle.read(buffer, offset, length, position) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `buffer` {Buffer|Uint8Array} * `offset` {integer} @@ -3497,7 +3497,7 @@ property that is a reference to the passed in `buffer` argument. #### filehandle.readFile(options) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `options` {Object|string} * `encoding` {string|null} **Default:** `null` @@ -3521,7 +3521,7 @@ The `FileHandle` has to support reading. #### filehandle.stat() <!-- YAML -added: REPLACEME +added: v10.0.0 --> * Returns: {Promise} @@ -3529,7 +3529,7 @@ Retrieves the [`fs.Stats`][] for the file. #### filehandle.sync() <!-- YAML -added: REPLACEME +added: v10.0.0 --> * Returns: {Promise} @@ -3538,7 +3538,7 @@ success. #### filehandle.truncate(len) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `len` {integer} **Default:** `0` * Returns: {Promise} @@ -3584,7 +3584,7 @@ The last three bytes are null bytes ('\0'), to compensate the over-truncation. #### filehandle.utimes(atime, mtime) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `atime` {number|string|Date} * `mtime` {number|string|Date}` @@ -3598,7 +3598,7 @@ This function does not work on AIX versions before 7.1, it will resolve the #### filehandle.write(buffer, offset, length, position) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `buffer` {Buffer|Uint8Array} * `offset` {integer} @@ -3629,7 +3629,7 @@ the end of the file. #### filehandle.writeFile(data, options) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `data` {string|Buffer|Uint8Array} * `options` {Object|string} @@ -3653,7 +3653,7 @@ without waiting for the `Promise` to be resolved (or rejected). ### fsPromises.access(path[, mode]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3693,7 +3693,7 @@ the error raised if the file is not accessible. ### fsPromises.appendFile(file, data[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `file` {string|Buffer|URL|FileHandle} filename or `FileHandle` @@ -3715,7 +3715,7 @@ for appending (using `fsPromises.open()`). ### fsPromises.chmod(path, mode) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3727,7 +3727,7 @@ arguments upon succces. ### fsPromises.chown(path, uid, gid) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3740,7 +3740,7 @@ upon success. ### fsPromises.copyFile(src, dest[, flags]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `src` {string|Buffer|URL} source filename to copy @@ -3795,7 +3795,7 @@ fsPromises.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL) ### fsPromises.fchmod(filehandle, mode) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3807,7 +3807,7 @@ success. ### fsPromises.fchown(filehandle, uid, gid) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3820,7 +3820,7 @@ the `Promise` with no arguments upon success. ### fsPromises.fdatasync(filehandle) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3831,7 +3831,7 @@ success. ### fsPromises.fstat(filehandle) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3841,7 +3841,7 @@ Retrieves the [`fs.Stats`][] for the given `filehandle`. ### fsPromises.fsync(filehandle) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3852,7 +3852,7 @@ success. ### fsPromises.ftruncate(filehandle[, len]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3901,7 +3901,7 @@ The last three bytes are null bytes ('\0'), to compensate the over-truncation. ### fsPromises.futimes(filehandle, atime, mtime) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -3917,7 +3917,7 @@ This function does not work on AIX versions before 7.1, it will resolve the ### fsPromises.lchmod(path, mode) <!-- YAML -deprecated: REPLACEME +deprecated: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3929,7 +3929,7 @@ no arguments upon success. This method is only implemented on macOS. ### fsPromises.lchown(path, uid, gid) <!-- YAML -deprecated: REPLACEME +deprecated: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3942,7 +3942,7 @@ no arguments upon success. This method is only implemented on macOS. ### fsPromises.link(existingPath, newPath) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `existingPath` {string|Buffer|URL} @@ -3953,7 +3953,7 @@ Asynchronous link(2). The `Promise` is resolved with no arguments upon success. ### fsPromises.lstat(path) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3964,7 +3964,7 @@ for the given symbolic link `path`. ### fsPromises.mkdir(path[, mode]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -3976,7 +3976,7 @@ arguments upon success. ### fsPromises.mkdtemp(prefix[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `prefix` {string} @@ -4006,7 +4006,7 @@ intention is to create a temporary directory *within* `/tmp`, the `prefix` ### fsPromises.open(path, flags[, mode]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4027,7 +4027,7 @@ a colon, Node.js will open a file system stream, as described by ### fsPromises.read(filehandle, buffer, offset, length, position) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -4056,7 +4056,7 @@ property that is a reference to the passed in `buffer` argument. ### fsPromises.readdir(path[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4074,7 +4074,7 @@ will be passed as `Buffer` objects. ### fsPromises.readFile(path[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL|FileHandle} filename or `FileHandle` @@ -4100,7 +4100,7 @@ Any specified `FileHandle` has to support reading. ### fsPromises.readlink(path[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4118,7 +4118,7 @@ returned will be passed as a `Buffer` object. ### fsPromises.realpath(path[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4143,7 +4143,7 @@ this restriction. ### fsPromises.rename(oldPath, newPath) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `oldPath` {string|Buffer|URL} @@ -4155,7 +4155,7 @@ upon success. ### fsPromises.rmdir(path) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4170,7 +4170,7 @@ error on POSIX. ### fsPromises.stat(path) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4180,7 +4180,7 @@ The `Promise` is resolved with the [`fs.Stats`][] object for the given `path`. ### fsPromises.symlink(target, path[, type]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `target` {string|Buffer|URL} @@ -4198,7 +4198,7 @@ the `target` argument will automatically be normalized to absolute path. ### fsPromises.truncate(path[, len]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4210,7 +4210,7 @@ success. The `path` *must* be a string or `Buffer`. ### fsPromises.unlink(path) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4221,7 +4221,7 @@ success. ### fsPromises.utimes(path, atime, mtime) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `path` {string|Buffer|URL} @@ -4240,7 +4240,7 @@ The `atime` and `mtime` arguments follow these rules: ### fsPromises.write(filehandle, buffer[, offset[, length[, position]]]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `filehandle` {FileHandle} @@ -4273,7 +4273,7 @@ the end of the file. ### fsPromises.writeFile(file, data[, options]) <!-- YAML -added: REPLACEME +added: v10.0.0 --> * `file` {string|Buffer|URL|FileHandle} filename or `FileHandle` |