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