UNPKG

@ou-imdt/utils

Version:

Utility library for interactive media development

9 lines 311 B
/** * Fetches a resource as plain text. * @param {string} url - The URL of the resource to fetch. * @returns {Promise<string>} A promise that resolves to a string containing the resource data. */ export default async function fetchText(url) { const response = await fetch(url); return response.text(); }