New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

disk-usage

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

disk-usage

Disk usage tool

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

Command line disk usage analyser

disk-usage is a command line disk analyser for *nix and Windows operating systems. It is similar to WinDirStat for Windows but for the command line :)

disk-usage screenshot 1

Installation

$ npm install -g disk-usage

Usage

Synopsis

  $ disk-usage [--sort size] [--group group] path
  $ dusk-usage --help

Options

  -g, --group string   Which field the results grouped by          
  -s, --sort string    Which field the results should be sorted by 
  -c, --count number   Number of results to display                
  -p, --path string    System path to start scanning               
  -r, --reverse        Reverse the results                         
  -h, --help           Display this help page     

Examples

Files in the current directory grouped by top level folder

$ disk-usage .

Files in your Documents folder and grouped by top level folder

$ disk-usage ~/Documents

Files in your Documents folder and group by the last modified date

$ disk-usage ~/Documents --group modified

Files in your Documents folder sorted by the number of files

$ disk-usage ~/Documents --sort files

Group results by modified date

$ disk-usage /lib --group modified

Group results by extension
```bash
$ disk-usage /lib --group extension

disk-usage screenshot 1

Also works on Windows

disk-usage screenshot 1

Using the lib

As well as using disk-usage as a console application you can also use the internal library in your node applications:

$ npm install --save disk-usage
const scanner = require('disk-usage')

const args = {
  path: '.',
  group: 'tld'
  sort: 'size',
  onError: (err) => {
    // disk access / permission error
  },
  onProgress (currentPath, currentStats) => {
    // called for each top level directory
  }
}

scanner
  .scan(args)
  .then((stats) => {
    // scan complete!
    console.log(stats)
  })

Keywords

disk

FAQs

Package last updated on 21 May 2016

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