Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

dirsize

coderaiser105MIT2.0.0

get directory size with emitter

directory, size, emitter

readme

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

changelog

2018.06.12, v2.0.0

feature:

  • (dirsize) drop support of node < 4
  • (package) format-io v1.0.1

2016.09.21, v1.0.3

feature:

  • (package) glob v7.1.0

2016.02.12, v1.0.2

feature:

  • (package) glob v7.0.0

2015.12.10, v1.0.1

feature:

  • (package) glob v6.0.1