New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diskstats

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diskstats

Get disk stats such as space used & inode usage, relies on df

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
688
increased by4.88%
Maintainers
1
Weekly downloads
 
Created
Source

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

Contributors

The following people have contributed to this library:

  • Philip Skinner
  • Alessia (d3lla) - https://hackerone.com/d3lla?type=user

Keywords

FAQs

Package last updated on 23 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc