-
-
Notifications
You must be signed in to change notification settings - Fork 12
getDriveDevice
xiao edited this page Nov 8, 2025
·
1 revision
get device path and device id of the specific drive.
callback:
fswin.getDriveDevice(letter, callback);async:
var result = await fswin.getDriveDeviceAsync(letter);sync:
var result = fswin.getDriveDeviceSync(letter);-
letteris a letter of the alphabet. -
callbackis a function that takes only one argumentresult. -
resultis an object that containsdeviceNumber,devicePath,deviceId,parentDeviceIdof the drive or null when failed.
var fswin = require('fswin');
var letter = 'c';
//sync
console.log(fswin.getDriveDeviceSync(letter));
//async
fswin.getDriveDevice(letter, console.log);