JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q55632F
  • License MIT

Get standard fetch from any environment.

Package Exports

  • @jswork/fetch
  • @jswork/fetch/dist/index.esm.js
  • @jswork/fetch/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jswork/fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fetch

Get standard fetch from any environment.

version license size download

installation

# browser + bun
yarn add @jswork/fetch

# nodejs
yarn add @jswork/fetch node-fetch@2.6.7

usage

Usage1: import package.

import fetch from '@jswork/fetch';

// as usually
const res = await fetch('https://api.github.com/users/afeiship');
console.log(res);

Usage2: Or import to global(recommend)

import '@jswork/fetch';

const res = await fetch('https://httpbin.org/get').then(r=>r.json())
console.log(res);

license

Code released under the MIT license.