balena-io-modules / fetch

fetch with happy eyeballs
1 stars 0 forks source link

@balena/fetch

This is Balena's implementation of fetch, but others could find it useful too.

Features:

This is meant to replace all naked calls to http.request, fetch, node-fetch, @balena/request, etc.

Installation

npm i --save @balena/fetch

Usage

import fetch from '@balena/fetch';

const resp = await fetch('https://api.balena-cloud.com/ping');
console.log(await resp.text()) // <= OK