Minimalistic HTTP client for the browser, based on the Fetch API. It provides a clean, promise-based interface for making HTTP requests (GET, POST, PUT, PATCH, DELETE, HEAD) with support for query parameters, custom headers, body type parsing (json, text, blob, etc.), mode and credentials configuration, and middleware. Current stable version is 1.4.2. It is designed to be future-proof with native Fetch, but requires a polyfill for older browsers. Lightweight alternative to axios with no external dependencies.
npm install traeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic GET and POST requests using trae with promises.
Use response.data instead of response.body for parsed response body.
Remove bodyType or set to undefined if you want raw response.
Use a fetch polyfill (e.g., 'whatwg-fetch') for Node.js or older browsers.
Ensure the first argument to HTTP method is a valid URL string.
Set config.mode to 'cors' or ensure server supports CORS. Also check for HTTPS vs HTTP mismatch.
Use trae.get or import trae correctly: import trae from 'trae'
No dependency data recorded yet.