Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

node-diskfree

0.1.0 • Public • Published

node-diskfree - NPM version

NPM

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

Installation

npm install node-diskfree

Usage

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

Tests

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

License

See LICENSE.md file.

Change Log

See CHANGE_LOG.md file.

Keywords

none

install

npm i node-diskfree

Downloadsweekly downloads

1,194

version

0.1.0

license

none

last publish

collaborators

  • avatar
Report a vulnerability