diff --git a/doc/api/fs.md b/doc/api/fs.md index 4421d80b3341ff..0cbc75602d5418 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1001,6 +1001,82 @@ The times in the stat object have the following semantics: Prior to Node.js 0.12, the `ctime` held the `birthtime` on Windows systems. As of 0.12, `ctime` is not "creation time", and on Unix systems, it never was. +## Class: `fs.StatFs` + +Provides information about a mounted filesystem. + +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 user. + +### `statfs.bfree` + +* {number|bigint} + +Free blocks in filesystem. + +### `statfs.blocks` + +* {number|bigint} + +Total data blocks in filesystem. + +### `statfs.bsize` + +* {number|bigint} + +Optimal transfer block size. + +### `statfs.ffree` + +* {number|bigint} + +Free file nodes in filesystem. + +### `statfs.files` + +* {number|bigint} + +Total file nodes in filesystem. + +### `statfs.type` + +* {number|bigint} + +Type of filesystem. + ## Class: `fs.WriteStream` + +* `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). The callback gets two arguments `(err, stats)` where +`stats` is an [`fs.StatFs`][] object. + +Returns information about the mounted filesystem which contains `path`. + +In case of an error, the `err.code` will be one of [Common System Errors][]. + +## `fs.statfsSync(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: {fs.StatFs} + +Synchronous statfs(2). + ## `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: {Promise} + +The `Promise` is resolved with the [`fs.StatFs`][] object for the given `path`. + ### `fsPromises.symlink(target, path[, type])`