Get the system disk of the computer (e.g.
C:
or/dev/sda
)
For Windows this module uses the %SystemDrive%
environment variable and the mount
command for macOS and Linux.
npm install system-disk
import systemDisk from 'system-disk';
const disk = await systemDisk();
console.log(disk);
// => C:
Returns the disk on the computer where the operating system is stored (the boot disk).
- @knutkirkhorn/free-space - Get the amount of free space for a drive