---
title: storageinfo
slug: develop/storageinfo
docTags: 
createdAt: 2025-03-27T16:56:38.485Z
---

The *storageinfo&#xA0;*&#x6F;bject provides information about a storage device connected to the player. To retrieve information about the filesystem on the device, use the *filesystem&#xA0;*&#x6F;bject.

:::hint{type="info"}
See [this page](docId\:qcEvA3OCMVeT4jzT5L6PE) for more information about device storage paths.
:::

**storageinfo IDL**

```javascript
[
    constructor(String path, String type)
] interface StorageInfo {
    Promise<Number> getDeviceSize();
    Promise<StorageDeviceInfo> getDeviceInfo();
    Promise<StorageDeviceHealth> getDeviceHealth();
};
 
interface StorageDeviceInfo {
    attribute String type;
    attribute Number size;
    [type == "SD"] attribute SDDeviceInfo sd;
    [type == "SATA"] attribute SATADeviceInfo sata;
};
 
interface SDDeviceInfo {
    attribute String productName;
    attribute String oemID;
    attribute String auSize;             //@Optional
    attribute String productRev;
    attribute String mfrDate;            //@Optional
    attribute String serial;             //@Optional
    attribute String signalVoltage;
    attribute String uhsMode;
    attribute Number specVersion;
    attribute String speedClass;         //@Optional
    attribute Number mfrID;
};
 
interface StorageDeviceHealth {
    attribute int percentageHealthUsed;
};
 
interface SATADeviceInfo {
    attribute String sataModel;
    attribute String sataVendor;
};
```

## Object Creation 

To create an *storageinfo* object, first load the `brightsign/storageinfo` module using the `require()` method. Then create an instance of the *storageinfo* class with a string value specifying the storage path.

```javascript
var StorageInfoClass = require("@brightsign/storageinfo");
var storageInfo = new StorageInfoClass("/storage/sd");
```

Use the following string values to specify different storage drives:

- `"/storage/usb1"` – The drive for USB storage devices connected to the player
- `"/storage/sd"` – The primary SD or microSD drive on the player.
- `"/storage/sd2"` – The internal microSD drive on players that support this (see [Storage Devices](docId\:mGdEFc6YvkIbeiUxH9J1O))
- `"/storage/ssd"` – The internal SSD on players that support this (see [Storage Devices](docId\:mGdEFc6YvkIbeiUxH9J1O))
- `"/storage/flash"` - The internal flash storage on the player

## StorageInfo

Use this interface to retrieve information about the storage device.

**getDeviceSize()**

```javascript
Promise <Number> getDeviceSize
```

Returns the total size of the storage device (in bytes).

:::hint{type="warning"}
The size returned by this method uses a different tool from the `size` parameter in the `StorageDeviceInfo` interface. The values returned using the two processes will be approximately, but not exactly, the same.
:::

**getDeviceInfo()**

```javascript
Promise <StorageDeviceInfo> getDeviceInfo()
```

Returns a `StorageDeviceInfo`  interface containing manufacturer information about the storage device.

**getDeviceHealth()**

```javascript
Promise<StorageDeviceHealth> getDeviceHealth()
```

Returns a "card wear" indication in the form of a percentage. This value is approximate and is provided to assist in scheduling proactive replacements to avoid in-field failures. Once this value reaches 100, the card is life expired and further attempts to write to the card may fail. This feature is only supported on certain industrial-type cards such as the Micron and Sandisk cards supplied by BrightSign.

## StorageDeviceInfo

This interface contains manufacturer information about the storage device. Any of the below parameters may be absent from the interface depending on the device type and the information returned by the device:

- `type` <font color="#6554c0">string</font>: The type of filesystem used on the specified storage.
- `size` <font color="#6554c0">Number</font>: The total size of the storage device (in bytes)
- `SDDeviceInfo` <font color="#6554c0">sd [type == "SD"]</font>: Returns details about the SD card hardware.
- `SATADeviceInfo` <font color="#6554c0">sata[type == "SATA"]</font> : Returns details about the Serial ATA (SATA) interface.

## SDDeviceInfo

- `productName` <font color="#6554c0">string</font>: The product name, as assigned by the device manufacturer (5 bytes for SD, 6 bytes for MMC)
- `oemID` <font color="#6554c0">string</font>: The two-character card OEM identifier as assigned by the SD Card Association
- `auSize`<font color="#6554c0"> number</font> <font color="#01a0af">optional</font>: The size of the SD AU in bytes
- `productRev` <font color="#6554c0">string</font>: The product revision assigned by the device manufacturer
- `mfrDate` <font color="#6554c0">string </font><font color="#01a0af">optional</font>: The manufacture date reported by the storage device
- `serial` <font color="#6554c0">string</font> <font color="#01a0af">optional</font>: The serial number of the storage device
- `signalVoltage` <font color="#6554c0">string</font>: The signal voltage reported by the SD card
- `uhsMode` <font color="#6554c0">string</font>: The UHS mode (i.e. BUS speed) reported by the SD card
- `specVersion` <font color="#6554c0">Number</font>: The version of SD spec to which the card conforms
- `speedClass` <font color="#6554c0">string</font> <font color="#01a0af">optional</font>: The speed class (if any) declared by the SD card
- `mfrID` <font color="#6554c0">Number</font>: The card manufacturer ID as assigned by the SD Card Association

## StorageDeviceHealth

- `percentageHealthUsed` <font color="#6554c0">int</font>: Returns an integer that indicates the "wear percentage" of disk health used, on Micron and SanDisk storage cards that support this feature.

## SATADeviceInfo

- `sataModel` <font color="#6554c0">String</font>: The SATA model reported by the device
- `sataVendor` <font color="#6554c0">String</font>: The SATA vendor reported by the device

## Example

```javascript
var storageClass = require("@brightsign/storageinfo");
var storage = new storageClass("/storage/usb1");


storage.getDeviceSize().then(
        function(data) {
            console.log(JSON.stringify(data));
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });

storage.getDeviceInfo().then(
        function(data) {
            console.log(JSON.stringify(data));
        })
    .catch(
        function(data) {
            console.log(JSON.stringify(data));
        });
```

