Get total diskspace and free diskspace using bindings around platform specific calls.
$ npm install diskusage
The module exposes a single function,
check. It takes a path/mount point as the first argument and a callback as the second. The callback takes two arguments
err will be non-zero if somethine went wrong.
info contains three members:
total in bytes.
available: Disk space available to the current user (i.e. Linux reserves 5% for root)
free: Disk space physically free
total: Total disk space (free + used)
statvfs under Linux also counts for mount points mounted under the root mount. For example using the mount point
/ as the first parameter would also account for
/run, etc. in the free and total spaces.
var disk = require'diskusage';// get disk usage. Takes path as first parameterdiskcheck'c:'console.loginfoavailable;console.loginfofree;console.loginfototal;;
var disk = require'diskusage';// get disk usage. Takes mount point as first parameterdiskcheck'/'console.loginfoavailable;console.loginfofree;console.loginfototal;;