@tauri-apps/plugin-fs - v2.4.1
    Preparing search index...

    Function readFile

    • Reads and resolves to the entire contents of a file as an array of bytes. TextDecoder can be used to transform the bytes to string if required.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

      import { readFile, BaseDirectory } from '@tauri-apps/plugin-fs';
      const contents = await readFile('avatar.png', { baseDir: BaseDirectory.Resource });

      2.0.0