fetch-s is a lightweight HTTP client built on top of the Fetch API, providing a Promise-based interface for making requests in browser and Node.js environments. Current stable version 1.3.1. It offers features like request timeout, interceptors, configurable defaults, and JSONP support. Unlike axios or ky, fetch-s retains native Fetch API response types and does not bundle a polyfill, making it smaller. Release cadence is intermittent. Maintained as a hobby project.
npm install fetch-sNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows GET, POST with timeout, and JSONP requests including error handling. Demonstrates default import and config options.
When posting JSON, explicitly set headers: { 'Content-Type': 'application/json' } and use JSON.stringify(data) if needed, though fetch-s does not auto-stringify.Update imports to use the default export as `fetchs` or check the version: `import fetchs from 'fetch-s'`.
If targeting older environments, install a fetch polyfill (e.g., cross-fetch, whatwg-fetch) and import it before fetch-s.
Use `data` for both URL params (GET) and body (POST). To avoid confusion, explicitly use `params` for URL params (not supported) or set method accordingly.
For GET requests, ensure `data` is empty or use `params` (not supported; use URLSearchParams or manually append to URL). fetch-s may attach data to the request body incorrectly.
Install a fetch polyfill like 'node-fetch' or 'cross-fetch' and import it before fetch-s, or upgrade Node.js to v18+.
Change import to default import: `import fetchs from 'fetch-s';`
No dependency data recorded yet.