-
Notifications
You must be signed in to change notification settings - Fork 1
EN_listDevices
Francisco M. E edited this page Jan 21, 2019
·
9 revisions
This method allow to read from JavaScript a list of hard disk devices mounted into operating system.
It's work in Linux, MAX or Windows.
const { lsDevices } = require('fs-hard-drive');
lsDevices()
.then(function (value) {
console.log(value);
})
.catch((err) => {
console.err(err);
});
When the method "then" launch de function pass as parameter an array of objects "Device":
- drive_type: DriveType enum (in linux or MAC it's equal to 0 all time, only works on Windows)
- caption: in windows "C:", in linux path
- description: Description from system of device
- file_system: "FAT32", "NTFS", "EXT4", ...
- size: Max size avilable in bytes
- free_space: Free space available in bytes
- so: Native information from sysmtem
- Unknown: 0
- NoRootDirectory: 1
- RemovableDisk: 2
- LocalDisk: 3
- NetworkDrive: 4
- CompactDisc: 5
- RAMDisk: 6