Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diskusage

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diskusage

Get total diskspace and free diskspace using bindings around platform specific calls.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122K
increased by4.25%
Maintainers
1
Weekly downloads
 
Created

What is diskusage?

The diskusage npm package is used to retrieve disk usage information for a given path. It provides a simple interface to get the total, free, and available disk space on a filesystem.

What are diskusage's main functionalities?

Get Disk Usage Information

This feature allows you to check the disk usage of a specified path. The code sample demonstrates how to use the diskusage package to get the total, free, and available disk space for the root directory.

const disk = require('diskusage');

// Path to check disk usage
const path = '/';

disk.check(path, (err, info) => {
  if (err) {
    console.error(err);
  } else {
    console.log(`Total: ${info.total}`);
    console.log(`Free: ${info.free}`);
    console.log(`Available: ${info.available}`);
  }
});

Other packages similar to diskusage

Keywords

FAQs

Package last updated on 15 Sep 2023

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