$app/server
import { function read(asset: string): ResponseRead the contents of an imported asset from the filesystem
read } from '$app/server';read
Available since 2.4.0
Read the contents of an imported asset from the filesystem
import { function read(asset: string): ResponseRead the contents of an imported asset from the filesystem
read } from '$app/server';
import const somefile: stringsomefile from './somefile.txt';
const const asset: Responseasset = function read(asset: string): ResponseRead the contents of an imported asset from the filesystem
read(const somefile: stringsomefile);
const const text: stringtext = await const asset: Responseasset.Body.text(): Promise<string>text();function read(asset: string): Response;previous next