Constructor
new SimpleFile(x, optionsopt)
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
Uint8Array | string | File | Contents of a file or a pointer to it. For browsers, this may be a File object; for Node.js, this may be a string containing a file path. |
||||||||||||
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Classes
Methods
buffer(optionsopt) → {Uint8Array}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
Contents of the file as an array.
- Type
- Uint8Array
content(optionsopt) → {Uint8Array|string}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
Contents of the file, as in SimpleFile.buffer
.
For Node.js, a string may also be returned containing the path to the original file.
- Type
- Uint8Array | string
name() → {string}
- Source:
Returns:
Name of the file, for disambiguation purposes.
- Type
- string
size() → {number}
- Source:
Returns:
Size of the file, in bytes.
- Type
- number