Registry / devops / frisbee

frisbee

JSON →
library3.1.4jsnpmunverified

Modern fetch-based HTTP client library (v3.1.4) for Node.js and React Native, designed as a lightweight alternative to axios, superagent, and request. It wraps the native fetch API with a clean, promise-based interface, automatic JSON parsing, and configurable base URI and headers. Active maintenance with regular patches. Key differentiators: simpler API than axios, smaller bundle, and built-in support for React Native without additional polyfills. Suitable for REST API calls in modern JavaScript environments.

npm install frisbee
INSTALL
IMPORT
SIG · FRISBEE
F
frisbee
devopsjavascriptv3.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import Frisbee from 'frisbee'
const Frisbee = require('frisbee')
Frisbee is ESM-only. CommonJS require may fail in Node <12 or bundlers configured for CJS. Use import for modern projects.
Frisbee
import { Frisbee } from 'frisbee'
Named export also available, same as default. Both work identically.
Frisbee as API
import API from 'frisbee'
const { API } = require('frisbee')
Destructuring the CommonJS require is a common mistake; the default export is the class itself.

Creates a Frisbee instance, sets baseURI and default headers, makes a GET request, and handles response.

import Frisbee from 'frisbee'; const api = new Frisbee({ baseURI: 'https://jsonplaceholder.typicode.com', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' } }); async function getTodos() { try { const res = await api.get('/todos/1'); console.log('Todo:', res.body); } catch (err) { console.error('Error:', err); } } getTodos();
Debug
Known issues
breakingIn v3, the `raw` option is no longer supported. The response object is always the fetch Response.
fix
Remove `raw: true` from options. Access response methods on the returned Response directly.
affects: <3.0.0
deprecatedThe `baseURI` option is optional. If not provided, relative URLs will throw. Best practice to always set baseURI.
fix
Provide a baseURI when creating the instance to avoid errors.
affects: *
gotchaFrisbee does not include a fetch polyfill. In older Node or some environments, you must provide one (e.g., node-fetch).
fix
Install node-fetch (or isomorphic-fetch) and assign to global: `global.fetch = require('node-fetch')` before using Frisbee.
affects: *
breakingVersions before v2.0.4 required `baseURI` to be set; it is now optional but recommended.
fix
Update to latest v3; baseURI is optional but provides a default for relative URLs.
affects: <2.0.4
gotchaIn React Native, form uploads may fail if you omit the `Content-Type` header. Frisbee sets it automatically for JSON but not for multipart.
fix
When uploading files, use FormData and let the fetch API set the boundary. Do not manually set Content-Type.
affects: *
Errors
Common errors & fixes
TypeError: fetch is not a function
Node.js environment missing fetch polyfill.
fix
Install node-fetch: `npm install node-fetch` and add `global.fetch = require('node-fetch');` before requiring frisbee.
Uncaught TypeError: Frisbee is not a constructor
Using default import incorrectly (e.g., `import { Frisbee } from 'frisbee'` might be correct, but in CJS `const Frisbee = require('frisbee')` also works; common mistake is destructuring incorrectly).
fix
Ensure using `import Frisbee from 'frisbee'` (default import) or `const { Frisbee } = require('frisbee')`.
Cannot find module 'frisbee'
Package not installed or import path incorrect.
fix
Run `npm install frisbee` and verify your import/require path (should be 'frisbee', not './frisbee').
Upgrade
Version history
3.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
frisbee — npm install frisbee · libregistry