• Get the Size of a Path (File or Directory)

    Type Parameters

    • Options extends {
          async?: boolean;
      }

    Parameters

    • path: string
    • Optional options: Options

    Returns Options["async"] extends false
        ? number
        : Promise<number>

    Example

    import { filesystem } from "@rjweb/utils"

    await filesystem.size('./node_modules') // 123456
    await filesystem.size('./package.json') // 1234

    Since

    1.12.3

    Supports

    nodejs