UNPKG

@ou-imdt/utils

Version:

Utility library for interactive media development

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