new FileSize(bytes)
Creates a new FileSize
Parameters:
Name | Type | Description |
---|---|---|
bytes |
number | Number of bytes |
Members
-
bytes :number Source
-
Number of bytes
-
static, constant B :number Source
-
1B in bytes
-
static, constant EB :number Source
-
1EB in bytes
-
static, constant GB :number Source
-
1GB in bytes
-
static, constant KB :number Source
-
1KB in bytes
-
static, constant MB :number Source
-
1MB in bytes
-
static, constant TB :number Source
-
1TB in bytes
-
static, constant UNITS :Array.<string> Source
-
List of available size units
Methods
-
toReadableString() → {string}
-
Returns this.bytes as human-readable file size string
Returns:
string - Human-readable file size string -
static getReadableString(bytes) → {string}
-
Returns human-readable file size string from given number of bytes
Parameters:
Name Type Description bytes
number Number of bytes Returns:
string - Human-readable file size string