fast-folder-size
Node CLI or module to calculate folder size.
It uses:
- Sysinternals DU on Windows, automatically downloaded at installation time because the license does not allow redistribution
- native
du
on other platforms
Installation
npm i fast-folder-size
Usage
Programmatically
const { promisify } = require('util')
const fastFolderSize = require('fast-folder-size')
const fastFolderSizeSync = require('fast-folder-size/sync')
fastFolderSize('.', (err, bytes) => {
if (err) {
throw err
}
console.log(bytes)
})
const fastFolderSizeAsync = promisify(fastFolderSize)
const bytes = await fastFolderSizeAsync('.')
console.log(bytes)
const bytes = fastFolderSizeSync('.')
console.log(bytes)
Command line
fast-folder-size .