readFile(file_path, [data_type], [encoding])
Class: SwingUI.
Description:
Synchronously reads a local file and returns its data.
NOTE: Memory limit set by JavaScript runtime and operating system limits the file size that can be read.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
string |
||
|
|
string |
"string" |
Desired return data type: "string", "Uint8Array", "ArrayBuffer", "Buffer". NOTE: |
|
|
string |
"utf-8" |
Text encoding to use. Only applies when |
Returns:
Returns the data in specified data type.
Type: string | Uint8Array | ArrayBuffer | Buffer
