diff --git a/doc/api/fs.md b/doc/api/fs.md index f8de227a9ad848..c6436b3ce10a19 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1525,6 +1525,19 @@ changes: * Returns: {Promise} Fulfills with the {fs.Stats} object for the given `path`. +### `fsPromises.statfs(path[, options])` + + + +* `path` {string|Buffer|URL} +* `options` {Object} + * `bigint` {boolean} Whether the numeric values in the returned + {fs.StatFs} object should be `bigint`. **Default:** `false`. +* Returns: {Promise} Fulfills with the {fs.StatFs} object for the + given `path`. + ### `fsPromises.symlink(target, path[, type])` + +* `path` {string|Buffer|URL} +* `options` {Object} + * `bigint` {boolean} Whether the numeric values in the returned + {fs.StatFs} object should be `bigint`. **Default:** `false`. +* `callback` {Function} + * `err` {Error} + * `stats` {fs.StatFs} + +Asynchronous statfs(2). Returns information about the mounted file system which +contains `path`. The callback gets two arguments `(err, stats)` where `stats` +is an {fs.StatFs} object. + +In case of an error, the `err.code` will be one of [Common System Errors][]. + ### `fs.symlink(target, path[, type], callback)` + +* `path` {string|Buffer|URL} +* `options` {Object} + * `bigint` {boolean} Whether the numeric values in the returned + {fs.StatFs} object should be `bigint`. **Default:** `false`. +* Returns: {fs.StatFs} + +Synchronous statfs(2). Returns information about the mounted file system which +contains `path`. + +In case of an error, the `err.code` will be one of [Common System Errors][]. + ### `fs.symlinkSync(target, path[, type])` + +Provides information about a mounted file system. + +Objects returned from [`fs.statfs()`][] and its synchronous counterpart are of +this type. If `bigint` in the `options` passed to those methods is `true`, the +numeric values will be `bigint` instead of `number`. + +```console +StatFs { + type: 1397114950, + bsize: 4096, + blocks: 121938943, + bfree: 61058895, + bavail: 61058895, + files: 999, + ffree: 1000000 +} +``` + +`bigint` version: + +```console +StatFs { + type: 1397114950n, + bsize: 4096n, + blocks: 121938943n, + bfree: 61058895n, + bavail: 61058895n, + files: 999n, + ffree: 1000000n +} +``` + +#### `statfs.bavail` + + + +* {number|bigint} + +Free blocks available to unprivileged users. + +#### `statfs.bfree` + + + +* {number|bigint} + +Free blocks in file system. + +#### `statfs.blocks` + + + +* {number|bigint} + +Total data blocks in file system. + +#### `statfs.bsize` + + + +* {number|bigint} + +Optimal transfer block size. + +#### `statfs.ffree` + + + +* {number|bigint} + +Free file nodes in file system. + +#### `statfs.files` + + + +* {number|bigint} + +Total file nodes in file system. + +#### `statfs.type` + + + +* {number|bigint} + +Type of file system. + ### Class: `fs.WriteStream`