createFile

Create a file in the Pod's filesystem

class BrowserPod {
async createFile(path: string, mode: string): Promise<BinaryFile | TextFile>;
}

Parameters

  • path (string) - Path of the newly-created file.
  • mode (string) - Opening mode. Either β€œbinary” or β€œutf-8”.

Returns

createFile 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 could not be created, the Promise will be rejected.

Was this page helpful?
Suggest changes