readFile
이 콘텐츠는 아직 번역되지 않았습니다.
Module @netwiv/api/plugins/fs · Kind Function
import { readFile } from '@netwiv/api/plugins/fs';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.
Signature
Section titled “Signature”function readFile(path: string | URL, options?: ReadFileOptions | undefined): Promise<Uint8Array<ArrayBuffer>>Example
Section titled “Example”import { readFile, BaseDirectory } from '@netwiv/api/plugins/fs';const contents = await readFile('avatar.png', { baseDir: BaseDirectory.Resource });Upstream since 2.0.0
Descriptions come from the pinned @tauri-apps/plugin-fs@2.5.2 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.