lup-system
Version:
NodeJS library to retrieve system information and utilization.
28 lines (27 loc) • 1.1 kB
TypeScript
export type DriveUtilization = {
/** The total amount of unused drive space in bytes. */
free: number;
/** The amount of drive space used in bytes. */
used: number;
/** The current drive utilization as a percentage (0-1). */
percentage: number;
};
export type DriveInfo = {
/** The device name of the drive (e.g., /dev/sda1) */
filesystem: string;
/** The mount point of the drive (e.g., /, /home) */
mount: string;
/** The filesystem type (e.g., ext4, ntfs) */
type: 'btrfs' | 'devtmpfs' | 'ext4' | 'ntfs' | 'overlay' | 'tmpfs' | 'vfat' | 'xfs' | string;
/** The total size of the drive in bytes. */
total: number;
/** Usage of the drive. */
utilization: DriveUtilization;
};
/**
* Returns information about the drives on the system (in Windows the logical drives are returned).
*
* @param includeVirtual If virtual drives should be included in the results (only relevant for Linux and macOS).
* @returns List of drive information objects.
*/
export declare function getDrives(includeVirtual?: boolean): Promise<DriveInfo[]>;