Noosphere Possibilities Maximized

npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

diskstats

0.0.1 • Public • Published

diskstats

This library uses df to pull disk information such as free space & inode utilization on your system. This library only works on systems where df is installed and present within your path.

Installation

Install with npm:

$ npm install diskstats

Usage

This module exposes two functions:

all

Takes no arguments, returns stats for all drives/partitions on the system. Can be used with a callback function or within a promise chain:

const diskstats = require('diskstats');

//callback
diskstats.all((err, results) => {
    console.log(results);
});

//promise
diskstats.all().then((results) => {
    console.log(results);
}).catch((err) => {
    console.log(err);
})

check

Takes a single argument, the path you would like to stat. This can be a relative path or an absolute path - relative paths will be relative to your process. Can be used with a callback function or within a promise chain:

const diskstats = require('diskstats');

//callback
diskstats.check('.', (err, results) => {
    console.log(results);
});

//promise
diskstats.check('.').then((results) => {
    console.log(results);
}).catch((err) => {
    console.log(err);
})

install

npm i diskstats

Downloadsweekly downloads

0

version

0.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability