new File(name, path, load, del, save)
Creates a File object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | name of the file |
path |
string | path to the file |
load |
function | function to load the file |
del |
function | function to delete the file |
save |
function | function to save new content to the file |
Members
name :string
name of the file
Type:
- string
path :string
path of the file
Type:
- string
Methods
delete() → {Promise.<void, error>}
Deletes the file.
Returns:
- Type
- Promise.<void, error>
load() → {Promise.<string, error>}
Loads the content of the File.
Returns:
- Type
- Promise.<string, error>
save(content) → {Promise.<void, error>}
Saves content to the file.
Parameters:
| Name | Type | Description |
|---|---|---|
content |
string | new content |
Returns:
- Type
- Promise.<void, error>