JSPM

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

Fetch wrapper

Package Exports

  • @zero-dependency/fetcher
  • @zero-dependency/fetcher/dist/index.cjs.js
  • @zero-dependency/fetcher/dist/index.es.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 (@zero-dependency/fetcher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@zero-dependency/fetcher

npm version npm bundle size (scoped) npm license

Installation

npm install @zero-dependency/fetcher
yarn add @zero-dependency/fetcher
pnpm add @zero-dependency/fetcher

Usage

import { Fetcher, fetcher } from '@zero-dependency/fetcher'

interface Post {
  id: number
  userId: number
  title: string
  body: string
}

const api = new Fetcher('https://jsonplaceholder.typicode.com')
const post = await api.get<Post>('/posts/1')
console.log(post) // { id: 1, postId: 1, ... }