2.0.0 • Published 6 years ago

dirsize v2.0.0

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

DirSize License NPM version Dependency Status Build Status

Get directory size with emitter.

Global

DirSize could be installed global with

npm i dirsize -g

And used this way:

Usage: dirsize [path]
Options:
  -h, --help      display this help and exit
  -v, --version   output version information and exit

dirsize /tmp

Local

dirsize could be used localy. It will emit event on every size change.

Install

npm i dirsize --save

How to use?

const dirsize = require('dirsize');
const cwd = process.cwd();
const from = cwd + '/pipe-io';
const abortOnError = false;

const size = dirsize(from);

size.on('size', (size, currentSize, filename) => {
    process.stdout.write('\r' + size);
});

size.on('error', (error) => {
    console.error(percent, ' -> ', name, ':', error.message);
    
    if (abortOnError)
        cp.abort();
});

size.on('end', () => {});

License

MIT

2.0.0

6 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago