Skip to content

iximiuz/node-diskusage-ng

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
January 12, 2023 20:21
August 20, 2017 16:18
August 20, 2017 16:18
January 15, 2021 21:50
May 7, 2020 12:13
August 20, 2017 16:18
November 29, 2022 04:54
January 15, 2023 19:47

diskusage-ng - get disk usage info in pure JavaScript and without any dependencies

Build Status

Supported operating systems:

  • Windows (via WMIC)
  • OSX/Linux/Posix (via df)

Usage

var diskusage = require('diskusage-ng');

diskusage('/home/me', function(err, usage) {
	if (err) return console.log(err);

	console.log(usage.total);
	console.log(usage.used);
	console.log(usage.available);
});

Commands

npm run test

Credits

  • Thanks to @xiaoxiangmoe for providing TypeScript type definitions.

  • Thanks to @Congelli501 for replacing child_process.exec with child_process.execFile on POSIX systems making the code much more secure.

  • Thanks to @mintaka-orionis for fixing long paths issue on POSIX systems.