Skip to content

getStorageProperties

xiao edited this page Nov 8, 2025 · 1 revision

get properties of the specific drive.

usage

callback:

fswin.getStorageProperties(path, properties, callback);

async:

var result = await fswin.getStoragePropertiesAsync(path, properties);

sync:

var result = fswin.getStoragePropertiesSync(path, properties);
  • path is the device path of a drive. which is usually start with \\?\ or \\.\.
  • properties is an object to determine what kind of properties to return. see example for details.
  • callback is a function that takes only one argument result.
  • result is an object when the path is accessible or null otherwise.

example

var fswin = require('fswin');
var path = '\\\\?\\PhysicalDrive0';
var properties = {
  deviceProperty: true,
  adapterProperty: true,
  deviceWriteCacheProperty: true,
  accessAlignmentProperty: true,
  deviceSeekPenalty: true,
  deviceTrim: true,
  deviceLBProvisioningProperty: true,
  devicePowerProperty: true,
  deviceCopyOffloadProperty: true,
  deviceMediumProductType: true,
  adapterRpmbProperty: true,
  deviceIoCapabilityProperty: true,
  adapterTemperatureProperty: true,
  deviceTemperatureProperty: true,
  adapterSerialNumber: true
};

//sync
console.log(fswin.getStoragePropertiesSync(path, properties));

//async
fswin.getStorageProperties(path, properties, console.log);

Clone this wiki locally