@tauri-apps/plugin-fs - v2.4.1
    Preparing search index...

    Function size

    • Get the size of a file or directory. For files, the stat functions can be used as well.

      If path is a directory, this function will recursively iterate over every file and every directory inside of path and therefore will be very time consuming if used on larger directories.

      Parameters

      • path: string | URL

      Returns Promise<number>

      import { size, BaseDirectory } from '@tauri-apps/plugin-fs';
      // Get the size of the `$APPDATA/tauri` directory.
      const dirSize = await size('tauri', { baseDir: BaseDirectory.AppData });
      console.log(dirSize); // 1024

      2.1.0