Need private packages and team management tools?Check out npm Teams »

diskusage-ng

0.2.4 • Public • Published

diskusage-ng - get disk usage info in pure JavaScript and without any dependencies

Build Status

Supported operating systems:

  • Windows (via WMIC)
  • OSX/Linux/Posix (via df)

Usage

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);
});

Posix notes

Filenames with " inside will be rejected with an explicit error. Bash substitution works, so for example diskusage('$HOME', ...) will show a diskusage for the user's home dir. It means that passing a raw user input to diskusage() can lead to arbitrary code execution.

Commands

npm run test

Install

npm i diskusage-ng

DownloadsWeekly Downloads

210

Version

0.2.4

License

MIT

Unpacked Size

12.9 kB

Total Files

10

Last publish

Collaborators

  • avatar