From 10904949de05b1793fc8b5a218216a58bbd94bfe Mon Sep 17 00:00:00 2001 From: Herrtian Date: Sat, 4 Apr 2026 10:40:28 +0200 Subject: [PATCH] doc: clarify fs.StatFs property descriptions - statfs.bsize: specify unit is bytes - statfs.frsize: clarify it's the unit for block counts - statfs.bavail: add note on calculating available space in bytes - statfs.bfree: add note on calculating free space in bytes - statfs.type: explain the numeric identifier and platform differences Fixes: https://github.com/nodejs/node/issues/50749 --- doc/api/fs.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 8c2e91fb2c8dbb..5dec734d0d29d7 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -7929,7 +7929,8 @@ added: * Type: {number|bigint} -Free blocks available to unprivileged users. +Free blocks available to unprivileged users. To calculate the available +space in bytes, multiply `statfs.bavail` by `statfs.frsize`. #### `statfs.bfree` @@ -7941,7 +7942,8 @@ added: * Type: {number|bigint} -Free blocks in file system. +Free blocks in file system. To calculate the free space in bytes, +multiply `statfs.bfree` by `statfs.frsize`. #### `statfs.blocks` @@ -7965,7 +7967,7 @@ added: * Type: {number|bigint} -Optimal transfer block size. +Optimal transfer block size, in bytes. #### `statfs.frsize` @@ -7975,7 +7977,8 @@ added: REPLACEME * Type: {number|bigint} -Fundamental file system block size. +Fundamental file system block size, in bytes. This is the unit used +for block counts (`statfs.blocks`, `statfs.bfree`, `statfs.bavail`). #### `statfs.ffree` @@ -8011,7 +8014,9 @@ added: * Type: {number|bigint} -Type of file system. +Type of file system. This is a numeric identifier corresponding to the +file system type (e.g., `0xEF53` for ext4, `0x01021997` for tmpfs on Linux). +On Windows, this value is not meaningful. ### Class: `fs.Utf8Stream`