Skip to content
This repository has been archived by the owner on Aug 20, 2019. It is now read-only.

Latest commit

 

History

History
59 lines (38 loc) · 1.88 KB

README.md

File metadata and controls

59 lines (38 loc) · 1.88 KB

This repository is no longer maintained please use at your own risk.

nodejs-disks

NPM

Gets current disk information from Server hosting nodejs application.

I have added the drive mount point name as well as calculating the percentage of used space and percentage of free space. Tested on OSX and ubuntu. Windows support coming soon.

Usage

var njds = require('nodejs-disks');
    njds.drives(
        function (err, drives) {
            njds.drivesDetail(
                drives,
                function (err, data) {
                    for(var i = 0; i<data.length; i++)
                    {
                        /* Get drive mount point */
                        console.log(data[i].mountpoint);

                        /* Get drive total space */
                        console.log(data[i].total);

                        /* Get drive used space */
                        console.log(data[i].used);

                        /* Get drive available space */
                        console.log(data[i].available);

                        /* Get drive name */
                        console.log(data[i].drive);

                        /* Get drive used percentage */
                        console.log(data[i].usedPer);

                        /* Get drive free percentage */
                        console.log(data[i].freePer);
                    }



                }
            );
        }
    )

LICENSE

nodejs-disks - see License.md file

This was derived from the original creator project, node-diskfree. Source for node-diskfree is available at https://bitbucket.org/pinchprojectbackend/node-diskfree/ license for this project is shown in OriginalLicense.md