-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation for fs.statfs with detailed descriptions and examples #57062
base: main
Are you sure you want to change the base?
Improve documentation for fs.statfs with detailed descriptions and examples #57062
Conversation
doc/api/fs.md
Outdated
@@ -4451,28 +4451,62 @@ Stats { | |||
} | |||
``` | |||
|
|||
### `fs.statfs(path[, options], callback)` | |||
### fs.statfs(path[, options], callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why you removed the backticks from the header
### fs.statfs(path[, options], callback) | |
### `fs.statfs(path[, options], callback)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! I’ve restored the backticks and fixed the parameter formatting for consistency. Please review the changes.
doc/api/fs.md
Outdated
#### **Parameters** | ||
- `path` **{string|Buffer|URL}** - The file or directory path to query. | ||
- `options` **{Object}** *(Optional)* | ||
- `bigint` **{boolean}** - If `true`, numeric values in the returned `fs.StatFs` object will be `BigInt` instead of `number`. Default: `false`. | ||
- `callback` **{Function}** - Function called with the result: | ||
- `err` **{Error}** - If an error occurs, contains error details. | ||
- `stats` **{fs.StatFs}** - Contains file system statistics. | ||
|
||
#### **Returned `fs.StatFs` Object Properties** | ||
The returned `fs.StatFs` object contains: | ||
- `type` **{number}** - The type of filesystem. | ||
- `bsize` **{number}** - Optimal transfer block size. | ||
- `blocks` **{number|BigInt}** - Total data blocks in the filesystem. | ||
- `bfree` **{number|BigInt}** - Free blocks available to unprivileged users. | ||
- `bavail` **{number|BigInt}** - Free blocks for privileged users. | ||
- `files` **{number|BigInt}** - Total file nodes in the filesystem. | ||
- `ffree` **{number|BigInt}** - Free file nodes. | ||
- `fsid` **{number}** - File system ID. | ||
- `namemax` **{number}** - Maximum filename length. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not align with the formatting for everything else. The ####
headers for parameters is unnecessary, as are the **
around the type indicators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! I’ve restored the backticks and fixed the parameter formatting for consistency. Please review the changes.
Summary
This PR enhances the documentation for
fs.statfs
by:fs.StatFs
object.bigint: true
options.Changes Made
doc/api/fs.md
with improved descriptions.Why?
Related Issue
Closes nodejs/node#50749
Let me know if any additional improvements are needed! 🚀