Supported operating systems:
- Windows (via WMIC)
- OSX/Linux/Posix (via df)
var diskusage = require('diskusage-ng');
diskusage('/home/me', function(err, usage) {
if (err) return console.log(err);
console.log(usage.total);
console.log(usage.used);
console.log(usage.available);
});
npm run test
-
Thanks to @xiaoxiangmoe for providing TypeScript type definitions.
-
Thanks to @Congelli501 for replacing
child_process.exec
withchild_process.execFile
on POSIX systems making the code much more secure. -
Thanks to @mintaka-orionis for fixing long paths issue on POSIX systems.