dir-util

Find and analyse recursively directories or files

dir-util.js

Node module to find and analyse directories or files using wrench-js and Async.js.

Read directory size recursive:

var dir = require('dir-util')
, options = {
        filters: ['\.js(on)*$'] //  just count .js or .json files: ['\.js(on)*$']
        , unit: 'kb'
    }
, path = '../'
;

dir.getSize(path, options, function(err, size) {
    console.log(dir.to(size, options.unit), options.unit);
});

Find directories and files recursive

var dir = require('dir-util')
, options = {
    filters: [/old/i, /\.bak$/i]
};

dir.find('../', options, function(err, files) {
    console.log((files));
});
var dir = require('dir-util')
dir.rm(path, callback);