File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8004,6 +8004,14 @@ added:
80048004
80058005Free blocks available to unprivileged users.
80068006
8007+ ` ` ` mjs
8008+ import { statfs } from ' node:fs/promises' ;
8009+
8010+ const stats = await statfs (' /' );
8011+ const availableSpaceInBytes = stats .bsize * stats .bavail ;
8012+ ` ` `
8013+
8014+
80078015#### ` statfs .bfree `
80088016
80098017<!-- YAML
@@ -8016,6 +8024,14 @@ added:
80168024
80178025Free blocks in file system.
80188026
8027+ ` ` ` mjs
8028+ import { statfs } from ' node:fs/promises' ;
8029+
8030+ const stats = await statfs (' /' );
8031+ const freeSpaceInBytes = stats .bsize * stats .bfree ;
8032+ ` ` `
8033+
8034+
80198035#### ` statfs .blocks `
80208036
80218037<!-- YAML
@@ -8028,6 +8044,14 @@ added:
80288044
80298045Total data blocks in file system.
80308046
8047+ ` ` ` mjs
8048+ import { statfs } from ' node:fs/promises' ;
8049+
8050+ const stats = await statfs (' /' );
8051+ const totalSpaceInBytes = stats .bsize * stats .blocks ;
8052+ ` ` `
8053+
8054+
80318055#### ` statfs .bsize `
80328056
80338057<!-- YAML
@@ -8038,7 +8062,7 @@ added:
80388062
80398063* Type: {number|bigint}
80408064
8041- Optimal transfer block size.
8065+ Optimal transfer block size in bytes .
80428066
80438067#### ` statfs .frsize `
80448068
@@ -8088,6 +8112,8 @@ added:
80888112
80898113Type of file system.
80908114
8115+ This is an OS-dependent numeric value representing the file system type.
8116+
80918117### Class: ` fs .Utf8Stream `
80928118
80938119<!-- YAML
You can’t perform that action at this time.
0 commit comments