Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Wrap native fetch responses in Result values.
npm install @wolfstar/safe-fetch
pnpm add @wolfstar/safe-fetch
yarn add @wolfstar/safe-fetch
bun add @wolfstar/safe-fetch
@sapphire/result
fetch
import { Json, safeFetch } from '@wolfstar/safe-fetch'; const result = await Json<{ id: number; name: string }>(safeFetch('https://api.example.org/users/1')); result.match({ ok: (user) => console.log(user.name), err: (error) => console.error(error) });