Node-fs-extra: Would you accept a PR for a function returning the total size of a specified directory?

Created on 11 Sep 2017  路  6Comments  路  Source: jprichardson/node-fs-extra

Something akin to:

lib.getTotalSize('./some/dir')
    .then((size) => {
        // Size === total combined size (in bytes) of all files held within specified directory
    });
wont-fix

Most helpful comment

@errorx666 Good points; I'm leaning against adding this.

All 6 comments

Not sure if this is within scope of this project; @jprichardson @manidlou ?


Have you tried any of these?

@RyanZim I'm currently using get-folder-size, but having a built-in function within fs-extra would be nice, as it would negate the need for yet another module. The functionality seemed like it was within scope, but maybe not. That's why I'm asking. :)

Not sure either!

Would this count physical size or logical size? Do you round up to nearest cluster? How do you count symlinks/hardlinks/junctions/mount points? How do you treat sparse files? Files compressed in the filesystem? Alternate data streams?

What sounds like a simple piece of functionality is actually quite complex.

@errorx666 Good points; I'm leaning against adding this.

Closing as per @errorx666

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matatk picture matatk  路  7Comments

RyanZim picture RyanZim  路  7Comments

monolithed picture monolithed  路  5Comments

milesj picture milesj  路  7Comments

louwers picture louwers  路  4Comments