@juit/lib-statvfs
v1.2.2
Published
Simple native bindings for "statvfs"
Downloads
30
Maintainers
Readme
Disk Statistics for NodeJS
... or ???
a wrapper adound
statvfs
This library just wraps the statvfs
system call, and returns all known
details to the caller in a nice Promise
.
import { statvfs } from '@juit/lib-statvfs'
// get the stats for our "/" (root) file system
const stats = await statvfs('/')
import { statvfs } from '../src/index'
// `stats` will now contain
// {
// blocks_total: 1023659n,
// blocks_free: 170084n,
// blocks_available: 118826n,
// blocks_used: 853575n,
// bytes_total: 4192907264n,
// bytes_free: 696664064n,
// bytes_available: 486711296n,
// bytes_used: 3496243200n,
// files_total: 262144n,
// files_free: 158621n,
// files_used: 103523n,
// percentage_used: 83.38,
// percentage_free: 16.61
// }
What's being returned?
Blocks!
blocks_total
(type:bigint
): The total number of blocks in the file systemblocks_free
(type:bigint
): The total number of free blocks in the file systemblocks_available
(type:bigint
): The total number of blocks available to non-superuser in the file systemblocks_used
(type:bigint
): The total number of used blocks in the file system
Bytes!
bytes_total
(type:bigint
): The total number of bytes in the file systembytes_free
(type:bigint
): The total number of free bytes in the file systembytes_available
(type:bigint
): The total number of bytes available to non-superuser in the file systembytes_used
(type:bigint
): The total number of used bytes in the file system
Files!
files_total
(type:bigint
): The total number of files in the file systemfiles_free
(type:bigint
): The total number of free files in the file systemfiles_used
(type:bigint
): The total number of used files in the file system
... and Percentages!
percentage_used
(type:number
): The percentage of used blocks/bytes in the file systempercentage_free
(type:number
): The percentage of free blocks/bytes in the file system