Skip to content

coderaiser/node-dirsize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

get directory size with emitter

Resources

License

Stars

Watchers

Forks

Packages

No packages published