Class: File

File(name, path, load, del, save)

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
Source:

Members

name :string

name of the file
Type:
  • string
Source:

path :string

path of the file
Type:
  • string
Source:

Methods

delete() → {Promise.<void, error>}

Deletes the file.
Source:
Returns:
Type
Promise.<void, error>

load() → {Promise.<string, error>}

Loads the content of the File.
Source:
Returns:
Type
Promise.<string, error>

save(content) → {Promise.<void, error>}

Saves content to the file.
Parameters:
Name Type Description
content string new content
Source:
Returns:
Type
Promise.<void, error>