openFile
Open a file in the Podโs filesystem
class BrowserPod { async openFile(path: string, mode: string): Promise<BinaryFile | TextFile>;}Parameters
- path (
string) - Path to an existing file - mode (
string) - Opening mode. Either โbinaryโ or โutf-8โ
Returns
openFile returns a Promise which is resolved when the operation has succeded. The promise resolves to a
BinaryFile object if mode="binary", and to a TextFile object if mode="utf-8". If the file does not exist, the Promise will be rejected.