@hcfy/node-fetch-polyfill
v1.1.0
Published
Global fetch polyfill based on node-fetch.
Downloads
1
Readme
@hcfy/node-fetch-polyfill
Global fetch polyfill based on node-fetch.
Usage
Install:
npm i @hcfy/node-fetch-polyfill
In CommonJS:
const readyPromise = require('@hcfy/node-fetch-polyfill').default
readyPromise.then(() => {
console.log(typeof globalThis.fetch === 'function') // true
})
node-fetch is a pure ESM package, so it must be loaded in CommonJS using await import('node-fetch')
.
In ECMAScript module:
import '@hcfy/node-fetch-polyfill'
console.log(typeof globalThis.fetch === 'function') // true