Get directory size for node
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.eslintrc
.eslintrc.test
.gitignore
.npmignore
.travis.yml
ChangeLog
LICENSE
README.md
package.json

README.md

Trammel License NPM version Dependency Status Build Status [![Coverage Status][CoverageIMGURL]][CoverageURL]

Get directory size.

If you want get realtime size updates use dirsize.

Example

const trammel = require('trammel');

trammel('.', (error, size) => {
    console.log(error, size);
    //undefined '58.47kb'
});

trammel('.', {type: 'raw'}, (error, size) => {
    console.log(error, size);
    //undefined 59974
});

trammel('do not exist', {stopOnError: true}, (error, size) => {
    if (error)
        return console.error(error.message);
    
    console.log(size);
});

License

MIT