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

    18

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • john.pinch