FileSize

FileSize

new FileSize(bytes)

Description:
  • Creates a new FileSize
Source:
Parameters:
Name Type Description
bytes number Number of bytes

Members

bytes :number

Description:
  • Number of bytes
Source:
Number of bytes
Type:
  • number

(static, constant) B :number

Description:
  • 1B in bytes
Source:
1B in bytes
Type:
  • number

(static, constant) EB :number

Description:
  • 1EB in bytes
Source:
1EB in bytes
Type:
  • number

(static, constant) GB :number

Description:
  • 1GB in bytes
Source:
1GB in bytes
Type:
  • number

(static, constant) KB :number

Description:
  • 1KB in bytes
Source:
1KB in bytes
Type:
  • number

(static, constant) MB :number

Description:
  • 1MB in bytes
Source:
1MB in bytes
Type:
  • number

(static, constant) TB :number

Description:
  • 1TB in bytes
Source:
1TB in bytes
Type:
  • number

(static, constant) UNITS :Array.<string>

Description:
  • List of available size units
Source:
List of available size units
Type:

Methods

toReadableString() → {string}

Description:
  • Returns this.bytes as human-readable file size string
Source:
Returns:
Human-readable file size string
Type
string

(static) getReadableString(bytes) → {string}

Description:
  • Returns human-readable file size string from given number of bytes
Source:
Parameters:
Name Type Description
bytes number Number of bytes
Returns:
Human-readable file size string
Type
string