IO.read

Returns all the data from the specified file. Converts the data from the specified charset to unicode.

IO.read(fileName, charset);

Arguments

Name Description
filename(string) The absolute path of the file.

charset

(Optional)

(string) The charset of the file, if it is not UTF-8.

Supported charsets: ['binary', 'UTF-8', 'UTF-16', 'base64', 'ANSI']

Return value

A promise fulfilled with a string upon success. Returns content of the specified file.

Example

Copy code
(async ()=>{
    let fileContent = await IO.read("file_path");
})();