@editorialapp/datatools
Version:
A collection of dependencies organized into useful tools for working with data in ways that are common in data cleaning and in building news apps.
15 lines (12 loc) • 352 B
JavaScript
import { fetch } from 'undici'
export { fetch } from 'undici'
export async function fetchText (url, options) {
const response = await fetch(url, options)
const text = await response.text()
return text
}
export async function fetchJson (url, options) {
const response = await fetch(url, options)
const json = await response.json()
return json
}