跳至主要內容

$app/server

import { function read(asset: string): Response

Read the contents of an imported asset from the filesystem

@examplejs import { read } from '$app/server'; import somefile from './somefile.txt'; const asset = read(somefile); const text = await asset.text();
@since2.4.0
read
} from '$app/server';

read

從檔案系統讀取導入的資源內容

import { function read(asset: string): Response

Read the contents of an imported asset from the filesystem

@examplejs import { read } from '$app/server'; import somefile from './somefile.txt'; const asset = read(somefile); const text = await asset.text();
@since2.4.0
read
} from '$app/server';
import const somefile: stringsomefile from './somefile.txt'; const const asset: Responseasset = function read(asset: string): Response

Read the contents of an imported asset from the filesystem

@examplejs import { read } from '$app/server'; import somefile from './somefile.txt'; const asset = read(somefile); const text = await asset.text();
@since2.4.0
read
(const somefile: stringsomefile);
const const text: stringtext = await const asset: Responseasset.Body.text(): Promise<string>text();
function read(asset: string): Response;

在 GitHub 上編輯此頁面

上一頁 下一頁