marcofugaro / fast-folder-size

Node CLI or module to calculate folder size

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fast-folder-size

ci

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')

// callback
fastFolderSize('.', (err, bytes) => {
  if (err) {
    throw err
  }

  console.log(bytes)
})

// promise
const fastFolderSizeAsync = promisify(fastFolderSize)
const bytes = await fastFolderSizeAsync('.')

console.log(bytes)

// sync
const bytes = fastFolderSizeSync('.')

console.log(bytes)

Command line

fast-folder-size .

About

Node CLI or module to calculate folder size


Languages

Language:JavaScript 90.1%Language:TypeScript 9.9%