lje.data
Simple persistent blob storage for scripts. Data is stored in a `.lje_script_data` folder relative to the working directory.
Functions
lje.data.write(name, data)
Note: Don't use file extensions, they are purposely omitted for security.
Writes a binary blob to the .lje_script_data folder under the given name. Creates the folder if it does not exist. Returns true on success, false on failure. Progress is always printed to the console.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the data entry to write. |
data | string | The raw data to store. May contain binary content. |
Returns
| Type | Description |
|---|---|
boolean |
|
lje.data.read(name)
Note: Don't use file extensions, they are purposely omitted for security.
Reads a previously written blob from the .lje_script_data folder. Returns nothing if the folder does not exist or if the entry is not found.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the data entry to read. |
Returns
| Type | Description |
|---|---|
string | nil | The stored data as a raw string, or |