node package manager

node-diskfree

Get used, available and total disk space. This module using 'df -k' for OSX system and 'df' for *nix system.

node-diskfree -

Get used, available and total disk space. This module using 'df -k' for OSX system and 'df' for *nix system.

npm install node-diskfree
var df = require('node-diskfree');
 
/* retrieve disks list */
df.drives(
function (errdrives) {
if (err) {
return console.log(err);
}
/* retrieve space information for each drives */
df.drivesDetail(
drives,
function (errdata) {
if (err) {
return console.log(err);
}
console.log(data);
}
);
/* or retrieve space information for on drive */
df.driveDetail(
drives[0],
function (errdata) {
if (err) {
return console.log(err);
}
console.log(data);
}
);
}
);

You can run these scripts :

  • to get information about first drive
npm run-script drive
  • to get information about all drives
npm run-script drives

See LICENSE.md file.

See CHANGE_LOG.md file.