Minimal wrapper around the global Fetch API for simpler JSON API consumption. Current stable version is 2.0.1, a single small file with TypeScript types. Unlike axios or node-fetch, it has zero dependencies and uses the built-in fetch available in Node 18+. The library throws on non-2xx responses and returns parsed JSON directly.
npm install tiny-fetch-jsonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows ESM import and basic usage with a JSON API, including error handling.
Use dynamic import() from CommonJS or migrate to ESM. Alternatively stay on 1.x.
Ensure global fetch is available. Use undici or node-fetch polyfill if needed.
Wrap calls in try-catch. To get the response body on error, you must use the native fetch directly.
Use import('tiny-fetch-json') dynamic import or migrate to ESM.Use 'import fetchJson from 'tiny-fetch-json'' or 'const fetchJson = require('tiny-fetch-json')'.Provide a global fetch polyfill such as 'undici' or 'node-fetch'.
No dependency data recorded yet.